diff options
author | 2014-12-23 15:30:54 +0800 | |
---|---|---|
committer | 2015-02-19 13:31:38 +0300 | |
commit | 982d6011bc30a26e8a3d546e0e7fc7db2c255d85 (patch) | |
tree | 3d1ee68f03edac2d64b7683baf15821cf14bdef7 /fs/ceph/super.h | |
parent | ceph: properly zero data pages for file holes. (diff) | |
download | linux-982d6011bc30a26e8a3d546e0e7fc7db2c255d85.tar.gz linux-982d6011bc30a26e8a3d546e0e7fc7db2c255d85.tar.bz2 linux-982d6011bc30a26e8a3d546e0e7fc7db2c255d85.zip |
ceph: improve reference tracking for snaprealm
When snaprealm is created, its initial reference count is zero.
But in some rare cases, the newly created snaprealm is not referenced
by anyone. This causes snaprealm with zero reference count not freed.
The fix is set reference count of newly snaprealm to 1. The reference
is return the function who requests to create the snaprealm. When the
function finishes its job, it releases the reference.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index e1aa32d0759d..72bc05a73b69 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -693,7 +693,8 @@ extern void ceph_get_snap_realm(struct ceph_mds_client *mdsc, extern void ceph_put_snap_realm(struct ceph_mds_client *mdsc, struct ceph_snap_realm *realm); extern int ceph_update_snap_trace(struct ceph_mds_client *m, - void *p, void *e, bool deletion); + void *p, void *e, bool deletion, + struct ceph_snap_realm **realm_ret); extern void ceph_handle_snap(struct ceph_mds_client *mdsc, struct ceph_mds_session *session, struct ceph_msg *msg); |