diff options
author | Xiubo Li <xiubli@redhat.com> | 2021-08-25 21:45:43 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-09-02 22:49:17 +0200 |
commit | a6d37ccdd240e80f26aaea0e62cda310e0e184d7 (patch) | |
tree | f3207e33f07507894073adae7227fb2aa97bf776 /fs/ceph/super.h | |
parent | b11ed50346683a749632ea664959b28d524d7395 (diff) |
ceph: remove the capsnaps when removing caps
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>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 3fad464d7c6d..e1d62e4e8780 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1163,6 +1163,12 @@ extern void ceph_put_cap_refs_no_check_caps(struct ceph_inode_info *ci, int had); extern void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr, struct ceph_snap_context *snapc); +extern void __ceph_remove_capsnap(struct inode *inode, + struct ceph_cap_snap *capsnap, + bool *wake_ci, bool *wake_mdsc); +extern void ceph_remove_capsnap(struct inode *inode, + struct ceph_cap_snap *capsnap, + bool *wake_ci, bool *wake_mdsc); extern void ceph_flush_snaps(struct ceph_inode_info *ci, struct ceph_mds_session **psession); extern bool __ceph_should_report_size(struct ceph_inode_info *ci); |