diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-11-13 17:10:27 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-11-14 20:44:51 +0300 |
commit | a81bc3102b4ffb885f34855d0133f862f915ab13 (patch) | |
tree | 5ce3d7f6ddc3c2b9ffbe43736f18115c9bc29948 /fs/xfs | |
parent | 31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c (diff) | |
download | linux-a81bc3102b4ffb885f34855d0133f862f915ab13.tar.xz |
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: 321fe13c9398 ("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>
Diffstat (limited to 'fs/xfs')
0 files changed, 0 insertions, 0 deletions