ceph: fix flush_snap logic after putting caps
authorJeff Layton <jlayton@kernel.org>
Thu, 10 Dec 2020 18:35:46 +0000 (13:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:08 +0000 (11:38 +0100)
commit95f432c0a396d37d7f763ca757bf8b6e49fa21cf
treeb0d1b2efbaae67f5a10a638602ae249414765552
parent426b8fb3d6724469937fb3d256397bdcf37d705d
ceph: fix flush_snap logic after putting caps

[ Upstream commit 64f36da5625f7f9853b86750eaa89d499d16a2e9 ]

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: e64f44a88465 ("ceph: skip checking caps when session reconnecting and releasing reqs")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/caps.c