android_kernel_motorola_sm6375/fs/ceph
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Luis Henriques 8074607871 ceph: don't return -ESTALE if there's still an open file
[ Upstream commit 878dabb64117406abd40977b87544d05bb3031fc ]

Similarly to commit 03f219041f ("ceph: check i_nlink while converting
a file handle to dentry"), this fixes another corner case with
name_to_handle_at/open_by_handle_at.  The issue has been detected by
xfstest generic/467, when doing:

 - name_to_handle_at("/cephfs/myfile")
 - open("/cephfs/myfile")
 - unlink("/cephfs/myfile")
 - sync; sync;
 - drop caches
 - open_by_handle_at()

The call to open_by_handle_at should not fail because the file hasn't been
deleted yet (only unlinked) and we do have a valid handle to it.  -ESTALE
shall be returned only if i_nlink is 0 *and* i_count is 1.

This patch also makes sure we have LINK caps before checking i_nlink.

Signed-off-by: Luis Henriques <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Acked-by: Amir Goldstein <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-06-24 17:50:37 +02:00
..
acl.c
addr.c
cache.c
cache.h
caps.c
ceph_frag.c
debugfs.c
dir.c
export.c ceph: don't return -ESTALE if there's still an open file 2020-06-24 17:50:37 +02:00
file.c
inode.c
io.c
io.h
ioctl.c
ioctl.h
Kconfig
locks.c
Makefile
mds_client.c
mds_client.h
mdsmap.c
quota.c
snap.c
strings.c
super.c
super.h
xattr.c