]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: improve reference tracking for snaprealm
authorYan, Zheng <zyan@redhat.com>
Tue, 23 Dec 2014 07:30:54 +0000 (15:30 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 19 Feb 2015 10:31:38 +0000 (13:31 +0300)
commite6cdbdd1ca5ee1929c0c6454ee0756ea225fffa8
tree3d1ee68f03edac2d64b7683baf15821cf14bdef7
parent8a70659be48387e6fed277282e4f4852b82f7db6
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>
fs/ceph/caps.c
fs/ceph/mds_client.c
fs/ceph/snap.c
fs/ceph/super.h