ceph: fix dentry leak when failing to init debugfs
authorChengguang Xu <cgxu519@icloud.com>
Fri, 9 Feb 2018 12:40:59 +0000 (20:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:04 +0000 (07:52 +0200)
commit6c88c93898ca3cebf27c5ea96585560bb81959a2
treed1a9820261d8ca2e6f00b0190c46f7da94a68598
parente080e814deb129f1e3b928af58f61177bd8e8dab
ceph: fix dentry leak when failing to init debugfs

[ Upstream commit 18106734b512664a8541026519ce4b862498b6c3 ]

When failing from ceph_fs_debugfs_init() in ceph_real_mount(),
there is lack of dput of root_dentry and it causes slab errors,
so change the calling order of ceph_fs_debugfs_init() and
open_root_dentry() and do some cleanups to avoid this issue.

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/super.c