Commit 64f36da5 authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov
Browse files

ceph: fix flush_snap logic after putting caps



A primary reason for skipping ceph_check_caps after putting the
references was to avoid the locking in ceph_check_caps during a
reconnect. __ceph_put_cap_refs can still call ceph_flush_snaps in that
case though, and that takes many of the same inconvenient locks.

Fix the logic in __ceph_put_cap_refs to skip flushing snaps when the
skip_checking_caps flag is set.

Fixes: e64f44a8 ("ceph: skip checking caps when session reconnecting and releasing reqs")
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent f40ddce8
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3093,10 +3093,12 @@ static void __ceph_put_cap_refs(struct ceph_inode_info *ci, int had,
	dout("put_cap_refs %p had %s%s%s\n", inode, ceph_cap_string(had),
	     last ? " last" : "", put ? " put" : "");

	if (last && !skip_checking_caps)
	if (!skip_checking_caps) {
		if (last)
			ceph_check_caps(ci, 0, NULL);
		else if (flushsnaps)
			ceph_flush_snaps(ci, NULL);
	}
	if (wake)
		wake_up_all(&ci->i_cap_wq);
	while (put-- > 0)