]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ceph: fix leak of osd authorizer
authorSage Weil <sage@newdream.net>
Thu, 27 May 2010 21:15:49 +0000 (14:15 -0700)
committerSage Weil <sage@newdream.net>
Sat, 29 May 2010 16:42:04 +0000 (09:42 -0700)
Release the ceph_authorizer when releasing osd state.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/osd_client.c

index afa7bb3895c4e637611f20e4d3ebd5938c2facf7..d25b4add85b4135249c77cbffc71bb2010170df5 100644 (file)
@@ -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);
+       }
 }
 
 /*