All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <aglo@umich.edu>
To: Trond Myklebust <trond.myklebust@primarydata.com>,
	Anna Schumaker <Anna.Schumaker@netapp.com>
Cc: linux-nfs <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/1] Recover from stateid-type error on SETATTR
Date: Tue, 21 Apr 2015 18:36:41 -0400	[thread overview]
Message-ID: <CAN-5tyHy+M4i2W+coBNXYxz-Ta3grYx=E+3vw7Y9=HE9heGjZQ@mail.gmail.com> (raw)

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. In general, when something calls
nfs4_handle_exception() with a null state, the operation should be
retried after bad delegation is removed.

Signed-off: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs4proc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ad7cf7e..fbde292 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -360,8 +360,11 @@ static int nfs4_handle_exception(struct
nfs_server *server, int errorcode, struc
         case -NFS4ERR_DELEG_REVOKED:
         case -NFS4ERR_ADMIN_REVOKED:
         case -NFS4ERR_BAD_STATEID:
-            if (state == NULL)
+            if (state == NULL) {
+                nfs4_inode_return_delegation(inode);
+                exception->retry = 1;
                 break;
+            }
             ret = nfs4_schedule_stateid_recovery(server, state);
             if (ret < 0)
                 break;
--

             reply	other threads:[~2015-04-21 22:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 22:36 Olga Kornievskaia [this message]
2015-04-27 17:48 ` [PATCH 1/1] Recover from stateid-type error on SETATTR Olga Kornievskaia
2015-05-04 16:24   ` Olga Kornievskaia
2015-06-12 18:30 Olga Kornievskaia
2015-06-12 18:37 ` Trond Myklebust
2015-06-12 18:48   ` Kornievskaia, Olga
2015-06-12 20:02     ` Trond Myklebust
2015-06-12 18:56   ` Anna Schumaker
2015-06-12 20:53 Olga Kornievskaia
2015-06-12 21:21 ` Trond Myklebust
2015-06-12 21:37   ` Kornievskaia, Olga
2015-06-12 21:42     ` Trond Myklebust
2015-06-15 16:03       ` Kornievskaia, Olga

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='CAN-5tyHy+M4i2W+coBNXYxz-Ta3grYx=E+3vw7Y9=HE9heGjZQ@mail.gmail.com' \
    --to=aglo@umich.edu \
    --cc=Anna.Schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.