]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fix deep mount refcounting on s_root
authorSage Weil <sage@newdream.net>
Fri, 27 Mar 2009 20:52:59 +0000 (13:52 -0700)
committerSage Weil <sage@newdream.net>
Fri, 27 Mar 2009 20:52:59 +0000 (13:52 -0700)
src/kernel/super.c

index 2631dcc5ac43005c91b4a61a5a6a2c87b99f0fdf..1d5b4fb204f71d23238da03ec234d9942b8c0889 100644 (file)
@@ -860,7 +860,10 @@ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt,
                err = PTR_ERR(root);
                goto out;
        }
-       client->sb->s_root = root;
+       if (client->sb->s_root)
+               dput(root);
+       else
+               client->sb->s_root = root;
 
        if (path[0] == 0) {
                dget(root);