From ee507a412f5d331575a0702a67a0d0c03a5d9e31 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 27 Mar 2009 13:52:59 -0700 Subject: [PATCH] kclient: fix deep mount refcounting on s_root --- src/kernel/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kernel/super.c b/src/kernel/super.c index 2631dcc5ac430..1d5b4fb204f71 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -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); -- 2.39.5