NFSD: Make nfsd4_rename() wait before returning NFS4ERR_DELAY
authorChuck Lever <chuck.lever@oracle.com>
Thu, 8 Sep 2022 22:14:19 +0000 (18:14 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 26 Sep 2022 18:02:40 +0000 (14:02 -0400)
commit68c522afd0b1936b48a03a4c8b81261e7597c62d
treef49d4870391ef789900fbc3397e003466df7a5b5
parent34b91dda7124fc3259e4b2ae53e0c933dedfec01
NFSD: Make nfsd4_rename() wait before returning NFS4ERR_DELAY

nfsd_rename() can kick off a CB_RECALL (via
vfs_rename() -> leases_conflict()) if a delegation is present.
Before returning NFS4ERR_DELAY, give the client holding that
delegation a chance to return it and then retry the nfsd_rename()
again, once.

This version of the patch handles renaming an existing file,
but does not deal with renaming onto an existing file. That
case will still always trigger an NFS4ERR_DELAY.

Link: https://bugzilla.linux-nfs.org/show_bug.cgi?id=354
Tested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
fs/nfsd/vfs.c