linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall
@ 2020-08-20 22:52 Olga Kornievskaia
  2020-08-25 19:34 ` Olga Kornievskaia
  0 siblings, 1 reply; 2+ messages in thread
From: Olga Kornievskaia @ 2020-08-20 22:52 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

From: Olga Kornievskaia <kolga@netapp.com>

A client should be able to handle getting an ERR_DELAY error
while doing a LOCK call to reclaim state due to delegation being
recalled. This is a transient error that can happen due to server
moving its volumes and invalidating its file location cache and
upon reference to it during the LOCK call needing to do an
expensive lookup (leading to an ERR_DELAY error on a PUTFH).

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

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index dbd01548335b..4a6cfb497103 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7298,7 +7298,12 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state,
 	err = nfs4_set_lock_state(state, fl);
 	if (err != 0)
 		return err;
-	err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
+	do {
+		err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
+		if (err != -NFS4ERR_DELAY)
+			break;
+		ssleep(1);
+	} while (err == -NFS4ERR_DELAY);
 	return nfs4_handle_delegation_recall_error(server, state, stateid, fl, err);
 }
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall
  2020-08-20 22:52 [PATCH 1/1] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall Olga Kornievskaia
@ 2020-08-25 19:34 ` Olga Kornievskaia
  0 siblings, 0 replies; 2+ messages in thread
From: Olga Kornievskaia @ 2020-08-25 19:34 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs

Any comments on this patch? Thank you.

On Thu, Aug 20, 2020 at 6:50 PM Olga Kornievskaia
<olga.kornievskaia@gmail.com> wrote:
>
> From: Olga Kornievskaia <kolga@netapp.com>
>
> A client should be able to handle getting an ERR_DELAY error
> while doing a LOCK call to reclaim state due to delegation being
> recalled. This is a transient error that can happen due to server
> moving its volumes and invalidating its file location cache and
> upon reference to it during the LOCK call needing to do an
> expensive lookup (leading to an ERR_DELAY error on a PUTFH).
>
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> ---
>  fs/nfs/nfs4proc.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index dbd01548335b..4a6cfb497103 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -7298,7 +7298,12 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state,
>         err = nfs4_set_lock_state(state, fl);
>         if (err != 0)
>                 return err;
> -       err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
> +       do {
> +               err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
> +               if (err != -NFS4ERR_DELAY)
> +                       break;
> +               ssleep(1);
> +       } while (err == -NFS4ERR_DELAY);
>         return nfs4_handle_delegation_recall_error(server, state, stateid, fl, err);
>  }
>
> --
> 2.18.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-25 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 22:52 [PATCH 1/1] NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall Olga Kornievskaia
2020-08-25 19:34 ` Olga Kornievskaia

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).