/[linux-patches]/genpatches-2.6/trunk/2.6.14/1466_15.6_nfs-client-directio-panic-compile-fix.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1466_15.6_nfs-client-directio-panic-compile-fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 8 months ago) by johnm
File MIME type: text/x-diff
File size: 1729 byte(s)
2.6.14-11, rebase against local tree
1 From nobody Mon Sep 17 00:00:00 2001
2 From: Chris Wright <chrisw@sous-sol.org>
3 Date: Wed, 1 Mar 2006 23:19:25 -0800
4 Subject: [PATCH] fs/nfs/direct.c compile fix
5
6 Compile fix:
7
8 fs/nfs/direct.c: In function 'nfs_get_user_pages':
9 fs/nfs/direct.c:110: warning: implicit declaration of function 'nfs_free_user_pages'
10 fs/nfs/direct.c: At top level:
11 fs/nfs/direct.c:127: warning: conflicting types for 'nfs_free_user_pages'
12 fs/nfs/direct.c:127: error: static declaration of 'nfs_free_user_pages' follows non-static declaration
13 fs/nfs/direct.c:110: error: previous implicit declaration of 'nfs_free_user_pages' was here
14
15 This should now be the same as fix that's going upstream.
16
17 Signed-off-by: Chris Wright <chrisw@sous-sol.org>
18 Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
19 ---
20
21 fs/nfs/direct.c | 7 ++++++-
22 1 files changed, 6 insertions(+), 1 deletion(-)
23
24 --- linux-2.6.15.5.orig/fs/nfs/direct.c
25 +++ linux-2.6.15.5/fs/nfs/direct.c
26 @@ -57,6 +57,7 @@
27 #define NFSDBG_FACILITY NFSDBG_VFS
28 #define MAX_DIRECTIO_SIZE (4096UL << PAGE_SHIFT)
29
30 +static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty);
31 static kmem_cache_t *nfs_direct_cachep;
32
33 /*
34 @@ -106,12 +107,16 @@ nfs_get_user_pages(int rw, unsigned long
35 result = get_user_pages(current, current->mm, user_addr,
36 page_count, (rw == READ), 0,
37 *pages, NULL);
38 + up_read(&current->mm->mmap_sem);
39 + /*
40 + * If we got fewer pages than expected from get_user_pages(),
41 + * the user buffer runs off the end of a mapping; return EFAULT.
42 + */
43 if (result >= 0 && result < page_count) {
44 nfs_free_user_pages(*pages, result, 0);
45 *pages = NULL;
46 result = -EFAULT;
47 }
48 - up_read(&current->mm->mmap_sem);
49 }
50 return result;
51 }

  ViewVC Help
Powered by ViewVC 1.1.20