]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
NFSD: Return NFS4ERR_FILE_OPEN only when renaming over an open file
authorChuck Lever <chuck.lever@oracle.com>
Sun, 26 Jan 2025 21:50:19 +0000 (16:50 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 10 Mar 2025 13:10:57 +0000 (09:10 -0400)
commit3b60984e79fcb040509f09464406ed1bc6fed6a0
tree4bdb3f09e851ba83f57f535140aa6d64170d3bbf
parent370345b4bd184a49ac68d6591801e5e3605b355a
NFSD: Return NFS4ERR_FILE_OPEN only when renaming over an open file

RFC 8881 Section 18.26.4 paragraphs 1 - 3 tell us that RENAME should
return NFS4ERR_FILE_OPEN only when the target object is a file that
is currently open. If the target is a directory, some other status
must be returned.

Generally I expect that a delegation recall will be triggered in
some of these circumstances. In other cases, the VFS might return
-EBUSY for other reasons, and NFSD has to ensure that errno does
not leak to clients as a status code that is not permitted by spec.

There are some error flows where the target dentry hasn't been
found yet. The default value for @type therefore is S_IFDIR to return
an alternate status code in those cases.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/vfs.c