kernel_optimize_test/fs/ceph
Jeff Layton a81bc3102b ceph: take the inode lock before acquiring cap refs
Most of the time, we (or the vfs layer) takes the inode_lock and then
acquires caps, but ceph_read_iter does the opposite, and that can lead
to a deadlock.

When there are multiple clients treading over the same data, we can end
up in a situation where a reader takes caps and then tries to acquire
the inode_lock. Another task holds the inode_lock and issues a request
to the MDS which needs to revoke the caps, but that can't happen until
the inode_lock is unwedged.

Fix this by having ceph_read_iter take the inode_lock earlier, before
attempting to acquire caps.

Fixes: 321fe13c93 ("ceph: add buffered/direct exclusionary locking for reads and writes")
Link: https://tracker.ceph.com/issues/36348
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2019-11-14 18:44:51 +01:00
..
acl.c
addr.c
cache.c
cache.h
caps.c
ceph_frag.c
debugfs.c
dir.c
export.c
file.c ceph: take the inode lock before acquiring cap refs 2019-11-14 18:44:51 +01:00
inode.c ceph: add missing check in d_revalidate snapdir handling 2019-10-29 22:29:55 +01:00
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 ceph: return -EINVAL if given fsc mount option on kernel w/o support 2019-11-07 18:03:23 +01:00
super.h
xattr.c