ceph: fix auth cap handling logic in remove_session_caps_cb
authorJeff Layton <jlayton@kernel.org>
Thu, 2 Sep 2021 16:47:01 +0000 (12:47 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Nov 2021 02:29:51 +0000 (03:29 +0100)
commit3c3050267e3c9a230f23a5621d7c6bd084d15094
tree59d272dacf493f6fc83e9e1e37791c0dff5bd19e
parentc35cac610a24f8b2e2d6f6535b7300d3bb2e5c29
ceph: fix auth cap handling logic in remove_session_caps_cb

The existing logic relies on ci->i_auth_cap being NULL, but if we end up
removing the auth cap early, then we'll do a lot of useless work and
lock-taking on the remaining caps. Ensure that we only do the auth cap
removal when we're _actually_ removing the auth cap.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c