[PATCH 1/1] Fix SETATTR to always retry on bad_stateid-type error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's insufficient to only retry SETATTR if we have a delegation
and got a bad_stateid-type error. A DELEGRETURN could be sent
after SETATTR is sent and before the reply comes back thus
no delegation would be found and SETATTR not retried with
zero stateid and instead fail the operation to EIO.

Signed-off-by: Olga Kornievskaia <kolga@xxxxxxxxxx>
---
 fs/nfs/nfs4proc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 327b8c3..c40d895 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2723,7 +2723,7 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
 		.state = state,
 		.inode = inode,
 	};
-	int err;
+	int err, save_err;
 	do {
 		err = _nfs4_do_setattr(inode, cred, fattr, sattr, state, ilabel, olabel);
 		switch (err) {
@@ -2742,7 +2742,14 @@ static int nfs4_do_setattr(struct inode *inode, struct rpc_cred *cred,
 				goto out;
 			}
 		}
+		save_err = err;
 		err = nfs4_handle_exception(server, err, &exception);
+		switch (save_err) {
+		case -NFS4ERR_DELEG_REVOKED:
+		case -NFS4ERR_ADMIN_REVOKED:
+		case -NFS4ERR_BAD_STATEID:
+			exception.retry = 1;
+		}
 	} while (exception.retry);
 out:
 	return err;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux