diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/direct.c | 12 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfsroot.c | 3 |
3 files changed, 14 insertions, 3 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 10ae377e68ff..4e9b3a1b36c5 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -57,6 +57,7 @@ | |||
57 | #define NFSDBG_FACILITY NFSDBG_VFS | 57 | #define NFSDBG_FACILITY NFSDBG_VFS |
58 | #define MAX_DIRECTIO_SIZE (4096UL << PAGE_SHIFT) | 58 | #define MAX_DIRECTIO_SIZE (4096UL << PAGE_SHIFT) |
59 | 59 | ||
60 | static void nfs_free_user_pages(struct page **pages, int npages, int do_dirty); | ||
60 | static kmem_cache_t *nfs_direct_cachep; | 61 | static kmem_cache_t *nfs_direct_cachep; |
61 | 62 | ||
62 | /* | 63 | /* |
@@ -107,6 +108,15 @@ nfs_get_user_pages(int rw, unsigned long user_addr, size_t size, | |||
107 | page_count, (rw == READ), 0, | 108 | page_count, (rw == READ), 0, |
108 | *pages, NULL); | 109 | *pages, NULL); |
109 | up_read(¤t->mm->mmap_sem); | 110 | up_read(¤t->mm->mmap_sem); |
111 | /* | ||
112 | * If we got fewer pages than expected from get_user_pages(), | ||
113 | * the user buffer runs off the end of a mapping; return EFAULT. | ||
114 | */ | ||
115 | if (result >= 0 && result < page_count) { | ||
116 | nfs_free_user_pages(*pages, result, 0); | ||
117 | *pages = NULL; | ||
118 | result = -EFAULT; | ||
119 | } | ||
110 | } | 120 | } |
111 | return result; | 121 | return result; |
112 | } | 122 | } |
@@ -481,7 +491,7 @@ retry: | |||
481 | if (wdata->verf.committed != NFS_FILE_SYNC) { | 491 | if (wdata->verf.committed != NFS_FILE_SYNC) { |
482 | need_commit = 1; | 492 | need_commit = 1; |
483 | if (memcmp(&first_verf.verifier, &wdata->verf.verifier, | 493 | if (memcmp(&first_verf.verifier, &wdata->verf.verifier, |
484 | sizeof(first_verf.verifier))); | 494 | sizeof(first_verf.verifier))) |
485 | goto sync_retry; | 495 | goto sync_retry; |
486 | } | 496 | } |
487 | 497 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 984ca3454d04..f8c0066e02e1 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1430,7 +1430,7 @@ static int nfs4_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, | |||
1430 | if (status == 0) | 1430 | if (status == 0) |
1431 | status = nfs4_do_fsinfo(server, fhandle, info); | 1431 | status = nfs4_do_fsinfo(server, fhandle, info); |
1432 | out: | 1432 | out: |
1433 | return status; | 1433 | return nfs4_map_errors(status); |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr) | 1436 | static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr) |
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c index e897e00c2c9d..c0a754ecdee6 100644 --- a/fs/nfs/nfsroot.c +++ b/fs/nfs/nfsroot.c | |||
@@ -465,10 +465,11 @@ static int __init root_nfs_ports(void) | |||
465 | "number from server, using default\n"); | 465 | "number from server, using default\n"); |
466 | port = nfsd_port; | 466 | port = nfsd_port; |
467 | } | 467 | } |
468 | nfs_port = htons(port); | 468 | nfs_port = port; |
469 | dprintk("Root-NFS: Portmapper on server returned %d " | 469 | dprintk("Root-NFS: Portmapper on server returned %d " |
470 | "as nfsd port\n", port); | 470 | "as nfsd port\n", port); |
471 | } | 471 | } |
472 | nfs_port = htons(nfs_port); | ||
472 | 473 | ||
473 | if ((port = root_nfs_getport(NFS_MNT_PROGRAM, mountd_ver, proto)) < 0) { | 474 | if ((port = root_nfs_getport(NFS_MNT_PROGRAM, mountd_ver, proto)) < 0) { |
474 | printk(KERN_ERR "Root-NFS: Unable to get mountd port " | 475 | printk(KERN_ERR "Root-NFS: Unable to get mountd port " |