From: Sage Weil Date: Thu, 27 May 2010 21:15:49 +0000 (-0700) Subject: ceph: fix leak of osd authorizer X-Git-Tag: v2.6.35-rc1~16^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79494d1b9b92259eb40ea6e939ba5aff4b8de5f1;p=platform%2Fkernel%2Flinux-3.10.git ceph: fix leak of osd authorizer Release the ceph_authorizer when releasing osd state. Signed-off-by: Sage Weil --- diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c index afa7bb3..d25b4ad 100644 --- a/fs/ceph/osd_client.c +++ b/fs/ceph/osd_client.c @@ -361,8 +361,13 @@ static void put_osd(struct ceph_osd *osd) { dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref), atomic_read(&osd->o_ref) - 1); - if (atomic_dec_and_test(&osd->o_ref)) + if (atomic_dec_and_test(&osd->o_ref)) { + struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth; + + if (osd->o_authorizer) + ac->ops->destroy_authorizer(ac, osd->o_authorizer); kfree(osd); + } } /*