X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Fsysfs%2Fmount.c;h=3eaf5c6622eb4fafc82137bc501aac803d7952f4;hb=e1aa17c7b52c2cc1a4c20f62deadcd94ce8b632c;hp=6211230814fd89dcc1a0a4b0acbabe000428e5b8;hpb=9df5a9b02fb59a4148bc93e0d20731c72aaffa5f;p=~andy%2Flinux diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index 6211230814f..3eaf5c6622e 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -27,6 +27,7 @@ static struct dentry *sysfs_mount(struct file_system_type *fs_type, { struct dentry *root; void *ns; + bool new_sb; if (!(flags & MS_KERNMOUNT)) { if (!capable(CAP_SYS_ADMIN) && !fs_fully_visible(fs_type)) @@ -37,8 +38,8 @@ static struct dentry *sysfs_mount(struct file_system_type *fs_type, } ns = kobj_ns_grab_current(KOBJ_NS_TYPE_NET); - root = kernfs_mount_ns(fs_type, flags, sysfs_root, ns); - if (IS_ERR(root)) + root = kernfs_mount_ns(fs_type, flags, sysfs_root, &new_sb, ns); + if (IS_ERR(root) || !new_sb) kobj_ns_drop(KOBJ_NS_TYPE_NET, ns); return root; }