diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 22:02:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 22:02:35 -0400 |
commit | 58df9b387c5f240566ac15b7fa5136f5a35bb19a (patch) | |
tree | cd3b216936037e67d71958cc3ee8060e1f628f4f /fs/nfs | |
parent | 8563f8786ee389c7861938d1d25336706f6de187 (diff) | |
parent | 14977489ffdb80d4caf5a184ba41b23b02fbacd9 (diff) |
Merge tag 'nfs-for-3.4-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfixes for Linux 3.4 from Trond Myklebust
Highlights include:
- Fix infinite loops in the mount code
- Fix a userspace buffer overflow in __nfs4_get_acl_uncached
- Fix a memory leak due to a double reference count in rpcb_getport_async()
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
* tag 'nfs-for-3.4-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
NFSv4: Minor cleanups for nfs4_handle_exception and nfs4_async_handle_error
NFSv4.1: Fix layoutcommit error handling
NFSv4: Fix two infinite loops in the mount code
SUNRPC: Use the already looked-up xprt in rpcb_getport_async()
NFS4.1: remove duplicate variable declaration in filelayout_clear_request_commit
Fix length of buffer copied in __nfs4_get_acl_uncached
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4filelayout.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 43 |
2 files changed, 23 insertions, 21 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 634c0bcb4fd6..5acfd9ea8a31 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c | |||
@@ -793,7 +793,6 @@ filelayout_clear_request_commit(struct nfs_page *req) | |||
793 | if (!test_and_clear_bit(PG_COMMIT_TO_DS, &req->wb_flags)) | 793 | if (!test_and_clear_bit(PG_COMMIT_TO_DS, &req->wb_flags)) |
794 | goto out; | 794 | goto out; |
795 | if (list_is_singular(&req->wb_list)) { | 795 | if (list_is_singular(&req->wb_list)) { |
796 | struct inode *inode = req->wb_context->dentry->d_inode; | ||
797 | struct pnfs_layout_segment *lseg; | 796 | struct pnfs_layout_segment *lseg; |
798 | 797 | ||
799 | /* From here we can find the bucket, but for the moment, | 798 | /* From here we can find the bucket, but for the moment, |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e809d2305ebf..f82bde005a82 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -270,7 +270,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc | |||
270 | case 0: | 270 | case 0: |
271 | return 0; | 271 | return 0; |
272 | case -NFS4ERR_OPENMODE: | 272 | case -NFS4ERR_OPENMODE: |
273 | if (nfs_have_delegation(inode, FMODE_READ)) { | 273 | if (inode && nfs_have_delegation(inode, FMODE_READ)) { |
274 | nfs_inode_return_delegation(inode); | 274 | nfs_inode_return_delegation(inode); |
275 | exception->retry = 1; | 275 | exception->retry = 1; |
276 | return 0; | 276 | return 0; |
@@ -282,10 +282,9 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc | |||
282 | case -NFS4ERR_DELEG_REVOKED: | 282 | case -NFS4ERR_DELEG_REVOKED: |
283 | case -NFS4ERR_ADMIN_REVOKED: | 283 | case -NFS4ERR_ADMIN_REVOKED: |
284 | case -NFS4ERR_BAD_STATEID: | 284 | case -NFS4ERR_BAD_STATEID: |
285 | if (state != NULL) | ||
286 | nfs_remove_bad_delegation(state->inode); | ||
287 | if (state == NULL) | 285 | if (state == NULL) |
288 | break; | 286 | break; |
287 | nfs_remove_bad_delegation(state->inode); | ||
289 | nfs4_schedule_stateid_recovery(server, state); | 288 | nfs4_schedule_stateid_recovery(server, state); |
290 | goto wait_on_recovery; | 289 | goto wait_on_recovery; |
291 | case -NFS4ERR_EXPIRED: | 290 | case -NFS4ERR_EXPIRED: |
@@ -2290,11 +2289,12 @@ static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, | |||
2290 | switch (err) { | 2289 | switch (err) { |
2291 | case 0: | 2290 | case 0: |
2292 | case -NFS4ERR_WRONGSEC: | 2291 | case -NFS4ERR_WRONGSEC: |
2293 | break; | 2292 | goto out; |
2294 | default: | 2293 | default: |
2295 | err = nfs4_handle_exception(server, err, &exception); | 2294 | err = nfs4_handle_exception(server, err, &exception); |
2296 | } | 2295 | } |
2297 | } while (exception.retry); | 2296 | } while (exception.retry); |
2297 | out: | ||
2298 | return err; | 2298 | return err; |
2299 | } | 2299 | } |
2300 | 2300 | ||
@@ -3712,7 +3712,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu | |||
3712 | if (acl_len > buflen) | 3712 | if (acl_len > buflen) |
3713 | goto out_free; | 3713 | goto out_free; |
3714 | _copy_from_pages(buf, pages, res.acl_data_offset, | 3714 | _copy_from_pages(buf, pages, res.acl_data_offset, |
3715 | res.acl_len); | 3715 | acl_len); |
3716 | } | 3716 | } |
3717 | ret = acl_len; | 3717 | ret = acl_len; |
3718 | out_free: | 3718 | out_free: |
@@ -3824,8 +3824,9 @@ nfs4_async_handle_error(struct rpc_task *task, const struct nfs_server *server, | |||
3824 | case -NFS4ERR_DELEG_REVOKED: | 3824 | case -NFS4ERR_DELEG_REVOKED: |
3825 | case -NFS4ERR_ADMIN_REVOKED: | 3825 | case -NFS4ERR_ADMIN_REVOKED: |
3826 | case -NFS4ERR_BAD_STATEID: | 3826 | case -NFS4ERR_BAD_STATEID: |
3827 | if (state != NULL) | 3827 | if (state == NULL) |
3828 | nfs_remove_bad_delegation(state->inode); | 3828 | break; |
3829 | nfs_remove_bad_delegation(state->inode); | ||
3829 | case -NFS4ERR_OPENMODE: | 3830 | case -NFS4ERR_OPENMODE: |
3830 | if (state == NULL) | 3831 | if (state == NULL) |
3831 | break; | 3832 | break; |
@@ -6111,21 +6112,22 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata) | |||
6111 | return; | 6112 | return; |
6112 | 6113 | ||
6113 | switch (task->tk_status) { /* Just ignore these failures */ | 6114 | switch (task->tk_status) { /* Just ignore these failures */ |
6114 | case NFS4ERR_DELEG_REVOKED: /* layout was recalled */ | 6115 | case -NFS4ERR_DELEG_REVOKED: /* layout was recalled */ |
6115 | case NFS4ERR_BADIOMODE: /* no IOMODE_RW layout for range */ | 6116 | case -NFS4ERR_BADIOMODE: /* no IOMODE_RW layout for range */ |
6116 | case NFS4ERR_BADLAYOUT: /* no layout */ | 6117 | case -NFS4ERR_BADLAYOUT: /* no layout */ |
6117 | case NFS4ERR_GRACE: /* loca_recalim always false */ | 6118 | case -NFS4ERR_GRACE: /* loca_recalim always false */ |
6118 | task->tk_status = 0; | 6119 | task->tk_status = 0; |
6119 | } | 6120 | break; |
6120 | 6121 | case 0: | |
6121 | if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN) { | ||
6122 | rpc_restart_call_prepare(task); | ||
6123 | return; | ||
6124 | } | ||
6125 | |||
6126 | if (task->tk_status == 0) | ||
6127 | nfs_post_op_update_inode_force_wcc(data->args.inode, | 6122 | nfs_post_op_update_inode_force_wcc(data->args.inode, |
6128 | data->res.fattr); | 6123 | data->res.fattr); |
6124 | break; | ||
6125 | default: | ||
6126 | if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN) { | ||
6127 | rpc_restart_call_prepare(task); | ||
6128 | return; | ||
6129 | } | ||
6130 | } | ||
6129 | } | 6131 | } |
6130 | 6132 | ||
6131 | static void nfs4_layoutcommit_release(void *calldata) | 6133 | static void nfs4_layoutcommit_release(void *calldata) |
@@ -6229,11 +6231,12 @@ nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle, | |||
6229 | case 0: | 6231 | case 0: |
6230 | case -NFS4ERR_WRONGSEC: | 6232 | case -NFS4ERR_WRONGSEC: |
6231 | case -NFS4ERR_NOTSUPP: | 6233 | case -NFS4ERR_NOTSUPP: |
6232 | break; | 6234 | goto out; |
6233 | default: | 6235 | default: |
6234 | err = nfs4_handle_exception(server, err, &exception); | 6236 | err = nfs4_handle_exception(server, err, &exception); |
6235 | } | 6237 | } |
6236 | } while (exception.retry); | 6238 | } while (exception.retry); |
6239 | out: | ||
6237 | return err; | 6240 | return err; |
6238 | } | 6241 | } |
6239 | 6242 | ||