https://github.com/torvalds/linux
Revision fed95bab8d29b928fcf6225be72d37ded452e8a2 authored by Li Zefan on 25 February 2014, 11:28:44 UTC, committed by Greg Kroah-Hartman on 25 February 2014, 15:37:52 UTC
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>
1 parent 6d0abec
History
Tip revision: fed95bab8d29b928fcf6225be72d37ded452e8a2 authored by Li Zefan on 25 February 2014, 11:28:44 UTC
sysfs: fix namespace refcnt leak
Tip revision: fed95ba
File Mode Size
Kconfig -rw-r--r-- 9.6 KB
Makefile -rw-r--r-- 702 bytes
acorn.c -rw-r--r-- 12.3 KB
acorn.h -rw-r--r-- 488 bytes
aix.c -rw-r--r-- 6.2 KB
aix.h -rw-r--r-- 59 bytes
amiga.c -rw-r--r-- 3.6 KB
amiga.h -rw-r--r-- 89 bytes
atari.c -rw-r--r-- 3.9 KB
atari.h -rw-r--r-- 1.0 KB
check.c -rw-r--r-- 4.2 KB
check.h -rw-r--r-- 1.1 KB
cmdline.c -rw-r--r-- 2.2 KB
cmdline.h -rw-r--r-- 57 bytes
efi.c -rw-r--r-- 22.5 KB
efi.h -rw-r--r-- 4.4 KB
ibm.c -rw-r--r-- 9.3 KB
ibm.h -rw-r--r-- 47 bytes
karma.c -rw-r--r-- 1.1 KB
karma.h -rw-r--r-- 124 bytes
ldm.c -rw-r--r-- 44.1 KB
ldm.h -rw-r--r-- 5.4 KB
mac.c -rw-r--r-- 3.4 KB
mac.h -rw-r--r-- 1.2 KB
msdos.c -rw-r--r-- 15.8 KB
msdos.h -rw-r--r-- 124 bytes
osf.c -rw-r--r-- 1.9 KB
osf.h -rw-r--r-- 123 bytes
sgi.c -rw-r--r-- 2.2 KB
sgi.h -rw-r--r-- 128 bytes
sun.c -rw-r--r-- 3.7 KB
sun.h -rw-r--r-- 169 bytes
sysv68.c -rw-r--r-- 1.9 KB
sysv68.h -rw-r--r-- 62 bytes
ultrix.c -rw-r--r-- 1.2 KB
ultrix.h -rw-r--r-- 90 bytes

back to top