diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-12 15:04:51 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-04-12 15:21:15 -0400 |
commit | b570a975ed276335dc7d148658c1f880ac0a507f (patch) | |
tree | 14fb6a82253c34fc65ed558bc97c0adbab21caf9 /fs/nfs | |
parent | b9536ad52152ff440231dcc2dd9cfa644f5413c9 (diff) |
NFSv4: Fix handling of revoked delegations by setattr
Currently, _nfs4_do_setattr() will use the delegation stateid if no
writeable open file stateid is available.
If the server revokes that delegation stateid, then the call to
nfs4_handle_exception() will fail to handle the error due to the
lack of a struct nfs4_state, and will just convert the error into
an EIO.
This patch just removes the requirement that we must have a
struct nfs4_state in order to invalidate the delegation and
retry.
Reported-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 83197fb60d5f..af05df3c7c79 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -304,9 +304,13 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc | |||
304 | case -NFS4ERR_DELEG_REVOKED: | 304 | case -NFS4ERR_DELEG_REVOKED: |
305 | case -NFS4ERR_ADMIN_REVOKED: | 305 | case -NFS4ERR_ADMIN_REVOKED: |
306 | case -NFS4ERR_BAD_STATEID: | 306 | case -NFS4ERR_BAD_STATEID: |
307 | if (inode != NULL && nfs4_have_delegation(inode, FMODE_READ)) { | ||
308 | nfs_remove_bad_delegation(inode); | ||
309 | exception->retry = 1; | ||
310 | break; | ||
311 | } | ||
307 | if (state == NULL) | 312 | if (state == NULL) |
308 | break; | 313 | break; |
309 | nfs_remove_bad_delegation(state->inode); | ||
310 | ret = nfs4_schedule_stateid_recovery(server, state); | 314 | ret = nfs4_schedule_stateid_recovery(server, state); |
311 | if (ret < 0) | 315 | if (ret < 0) |
312 | break; | 316 | break; |