diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-06-17 16:48:21 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-06-24 12:01:00 -0400 |
commit | dd1beb3d16f6a10683b84b89a4644065c43910f3 (patch) | |
tree | 21b31ac3f2ee2cda70d9766e90b6c37f309b3c34 | |
parent | e5241e43883058b61a955b4bbd677fe4ffd3ae4e (diff) |
NFS/pnfs: handle bad delegation stateids in nfs4_layoutget_handle_exception
We must call nfs4_handle_exception() on BAD_STATEID errors. The only
exception is if the stateid argument turns out to be a layout stateid
that is declared invalid.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 27fe63b502d5..406dd3eb68e2 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -7924,8 +7924,8 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, | |||
7924 | break; | 7924 | break; |
7925 | } | 7925 | } |
7926 | lo = NFS_I(inode)->layout; | 7926 | lo = NFS_I(inode)->layout; |
7927 | if (lo && nfs4_stateid_match(&lgp->args.stateid, | 7927 | if (lo && !test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags) && |
7928 | &lo->plh_stateid)) { | 7928 | nfs4_stateid_match_other(&lgp->args.stateid, &lo->plh_stateid)) { |
7929 | LIST_HEAD(head); | 7929 | LIST_HEAD(head); |
7930 | 7930 | ||
7931 | /* | 7931 | /* |
@@ -7936,10 +7936,10 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, | |||
7936 | pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0); | 7936 | pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0); |
7937 | spin_unlock(&inode->i_lock); | 7937 | spin_unlock(&inode->i_lock); |
7938 | pnfs_free_lseg_list(&head); | 7938 | pnfs_free_lseg_list(&head); |
7939 | status = -EAGAIN; | ||
7940 | goto out; | ||
7939 | } else | 7941 | } else |
7940 | spin_unlock(&inode->i_lock); | 7942 | spin_unlock(&inode->i_lock); |
7941 | status = -EAGAIN; | ||
7942 | goto out; | ||
7943 | } | 7943 | } |
7944 | 7944 | ||
7945 | status = nfs4_handle_exception(server, status, exception); | 7945 | status = nfs4_handle_exception(server, status, exception); |