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: 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>
2019-11-14 18:44:51 +01:00
..
2019-09-27 15:10:34 -07:00
2019-11-09 08:51:37 -08:00
2019-09-19 09:42:37 -07:00
2019-07-12 17:37:53 -07:00
\n
2019-09-21 13:53:34 -07:00
2019-09-29 19:25:39 -07:00
2019-09-21 14:26:33 -07:00
2019-09-19 09:42:37 -07:00
2019-09-19 09:42:37 -07:00
2019-07-03 17:52:09 -04:00
2019-09-27 17:00:27 -07:00
2019-09-27 17:00:27 -07:00
2019-09-19 10:21:35 -07:00
2019-10-19 06:32:32 -04:00
2019-08-30 08:11:25 -07:00
2019-09-19 09:42:37 -07:00
2019-09-18 17:35:20 -07:00
2019-07-15 21:20:52 -07:00
2019-04-08 18:21:02 -05:00
2019-08-07 21:51:47 -04:00
2019-03-08 14:48:40 -08:00
2019-09-18 16:59:14 -07:00
2019-10-14 15:04:01 -07:00
2019-09-27 17:00:27 -07:00
2019-09-18 16:59:14 -07:00
2019-08-01 20:51:23 +02:00
2019-09-25 17:51:41 -07:00