aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlga Kornievskaia <[email protected]>2015-06-12 16:53:30 -0400
committerTrond Myklebust <[email protected]>2015-06-16 11:29:46 -0400
commitae2ffef383fad723690a4c5bad70f7035fd7d71a (patch)
tree52689843929c12b2e1079af16e82311ccfd08b93
parentdf05a49f7204d81ba0e29fda3d56ccb730f05d87 (diff)
Recover from stateid-type error on SETATTR
Client can receives stateid-type error (eg., BAD_STATEID) on SETATTR when delegation stateid was used. When no open state exists, in case of application calling truncate() on the file, client has no state to recover and fails with EIO. Instead, upon such error, return the bad delegation and then resend the SETATTR with a zero stateid. Signed-off: Olga Kornievskaia <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
-rw-r--r--fs/nfs/nfs4proc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d181090124db..6bcdecd61125 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -370,8 +370,14 @@ int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_
case -NFS4ERR_DELEG_REVOKED:
case -NFS4ERR_ADMIN_REVOKED:
case -NFS4ERR_BAD_STATEID:
- if (state == NULL)
+ if (state == NULL) {
+ if (inode && nfs4_have_delegation(inode,
+ FMODE_READ)) {
+ nfs4_inode_return_delegation(inode);
+ exception->retry = 1;
+ }
break;
+ }
ret = nfs4_schedule_stateid_recovery(server, state);
if (ret < 0)
break;