All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <aglo@umich.edu>
To: linux-nfs <linux-nfs@vger.kernel.org>
Subject: Looping on ERR_OLD_STATEID on LOCK
Date: Tue, 27 Feb 2018 12:09:04 -0500	[thread overview]
Message-ID: <CAN-5tyHmCj=OeC--a9d51oPZL1GXku-Oj=oPAM=_0040Qz6AHA@mail.gmail.com> (raw)

Hi folks,

I'd like to understand why nfs4_do_handle_exception() for
ERR_OLD_STATEID just retries the operation. What happens is that the
client resends that same operation with the same stateid over to the
server and gets the same ERR_OLD_STATEID back which puts the client in
an infinite loop (and a hung state).

Shouldn't the client instead treat ERR_OLD_STATEID same as ERR_BAD_STATEID?

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c8b554a..2e006bc 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -411,6 +411,7 @@ static int nfs4_do_handle_exception(struct
nfs_server *server,
  case -NFS4ERR_ADMIN_REVOKED:
  case -NFS4ERR_EXPIRED:
  case -NFS4ERR_BAD_STATEID:
+ case -NFS4ERR_OLD_STATEID:
  if (inode != NULL && stateid != NULL) {
  nfs_inode_find_state_and_recover(inode,
  stateid);
@@ -477,7 +478,6 @@ static int nfs4_do_handle_exception(struct
nfs_server *server,
  return 0;

  case -NFS4ERR_RETRY_UNCACHED_REP:
- case -NFS4ERR_OLD_STATEID:
  exception->retry = 1;
  break;
  case -NFS4ERR_BADOWNER:

Or alternative, for the LOCK it should be:
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c8b554a..ce846faf 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6441,6 +6441,7 @@ static void nfs4_handle_setlk_error(struct
nfs_server *server, struct nfs4_lock_
  case -NFS4ERR_ADMIN_REVOKED:
  case -NFS4ERR_EXPIRED:
  case -NFS4ERR_BAD_STATEID:
+ case -NFS4ERR_OLD_STATEID:
  lsp->ls_seqid.flags &= ~NFS_SEQID_CONFIRMED;
  if (new_lock_owner != 0 ||
    test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) != 0)

             reply	other threads:[~2018-02-27 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 17:09 Olga Kornievskaia [this message]
2018-02-28 14:03 ` Looping on ERR_OLD_STATEID on LOCK Trond Myklebust

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-5tyHmCj=OeC--a9d51oPZL1GXku-Oj=oPAM=_0040Qz6AHA@mail.gmail.com' \
    --to=aglo@umich.edu \
    --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 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.