]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFSv4: xattr handlers should check for absent nfs filehandles
authorScott Mayhew <smayhew@redhat.com>
Wed, 16 Apr 2025 15:23:38 +0000 (11:23 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 08:57:54 +0000 (10:57 +0200)
commit7444832f405591212b11af52d1c9262b0753fc0a
treef107d24bba3d5a821f5478bfc5a06e5045003713
parentd860219d50b5c1256c4a1f91ab5f6c20a10b6969
NFSv4: xattr handlers should check for absent nfs filehandles

[ Upstream commit 6e9a2f8dbe93c8004c2af2c0158888628b7ca034 ]

The nfs inodes for referral anchors that have not yet been followed have
their filehandles zeroed out.

Attempting to call getxattr() on one of these will cause the nfs client
to send a GETATTR to the nfs server with the preceding PUTFH sans
filehandle.  The server will reply NFS4ERR_NOFILEHANDLE, leading to -EIO
being returned to the application.

For example:

$ strace -e trace=getxattr getfattr -n system.nfs4_acl /mnt/t/ref
getxattr("/mnt/t/ref", "system.nfs4_acl", NULL, 0) = -1 EIO (Input/output error)
/mnt/t/ref: system.nfs4_acl: Input/output error
+++ exited with 1 +++

Have the xattr handlers return -ENODATA instead.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs4proc.c