2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-30 16:13:54 +08:00
linux-next/fs/kernfs
Li Zefan fed95bab8d sysfs: fix namespace refcnt leak
As mount() and kill_sb() is not a one-to-one match, we shoudn't get
ns refcnt unconditionally in sysfs_mount(), and instead we should
get the refcnt only when kernfs_mount() allocated a new superblock.

v2:
- Changed the name of the new argument, suggested by Tejun.
- Made the argument optional, suggested by Tejun.

v3:
- Make the new argument as second-to-last arg, suggested by Tejun.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
 ---
 fs/kernfs/mount.c      | 8 +++++++-
 fs/sysfs/mount.c       | 5 +++--
 include/linux/kernfs.h | 9 +++++----
 3 files changed, 15 insertions(+), 7 deletions(-)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-25 07:37:52 -08:00
..
dir.c kernfs: make kernfs_deactivate() honor KERNFS_LOCKDEP flag 2014-02-05 11:44:04 -08:00
file.c kernfs: associate a new kernfs_node with its parent on creation 2014-01-17 11:50:07 -08:00
inode.c kernfs: s/sysfs/kernfs/ in internal functions and whatever is left 2013-12-11 17:39:20 -08:00
kernfs-internal.h kernfs: associate a new kernfs_node with its parent on creation 2014-01-17 11:50:07 -08:00
Makefile sysfs, kernfs: add skeletons for kernfs 2013-11-27 13:28:24 -08:00
mount.c sysfs: fix namespace refcnt leak 2014-02-25 07:37:52 -08:00
symlink.c kernfs: associate a new kernfs_node with its parent on creation 2014-01-17 11:50:07 -08:00