ceph: remove the capsnaps when removing caps
authorXiubo Li <xiubli@redhat.com>
Wed, 25 Aug 2021 13:45:43 +0000 (21:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Sep 2021 12:09:00 +0000 (14:09 +0200)
commit487ead34a208c1da9da7fc9f776b517680255ca1
treeec87cb95b55599bceaac01205a2e4c7acfd26b99
parent386fd6fd01bd1ee92640f97c0d0e06e204641c9f
ceph: remove the capsnaps when removing caps

[ Upstream commit a6d37ccdd240e80f26aaea0e62cda310e0e184d7 ]

capsnaps will take inode references via ihold when queueing to flush.
When force unmounting, the client will just close the sessions and
may never get a flush reply, causing a leak and inode ref leak.

Fix this by removing the capsnaps for an inode when removing the caps.

URL: https://tracker.ceph.com/issues/52295
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/caps.c
fs/ceph/mds_client.c
fs/ceph/super.h