From: Olga Kornievskaia <kolga@netapp.com>
To: <Trond.Myklebust@primarydata.com>
Cc: <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/1] Fix SETATTR to always retry on bad_stateid-type error
Date: Fri, 10 Jun 2016 14:37:18 -0400 [thread overview]
Message-ID: <1465583838-19029-1-git-send-email-kolga@netapp.com> (raw)
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@netapp.com>
---
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
reply other threads:[~2016-06-10 18:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465583838-19029-1-git-send-email-kolga@netapp.com \
--to=kolga@netapp.com \
--cc=Trond.Myklebust@primarydata.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).