linux-stable/fs/orangefs
Zhang Xiaoxu e27fb26e75 orangefs: Fix sysfs not cleanup when dev init failed
[ Upstream commit ea60a4ad0c ]

When the dev init failed, should cleanup the sysfs, otherwise, the
module will never be loaded since can not create duplicate sysfs
directory:

  sysfs: cannot create duplicate filename '/fs/orangefs'

  CPU: 1 PID: 6549 Comm: insmod Tainted: G        W          6.0.0+ #44
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014
  Call Trace:
   <TASK>
   dump_stack_lvl+0x34/0x44
   sysfs_warn_dup.cold+0x17/0x24
   sysfs_create_dir_ns+0x16d/0x180
   kobject_add_internal+0x156/0x3a0
   kobject_init_and_add+0xcf/0x120
   orangefs_sysfs_init+0x7e/0x3a0 [orangefs]
   orangefs_init+0xfe/0x1000 [orangefs]
   do_one_initcall+0x87/0x2a0
   do_init_module+0xdf/0x320
   load_module+0x2f98/0x3330
   __do_sys_finit_module+0x113/0x1b0
   do_syscall_64+0x35/0x80
   entry_SYSCALL_64_after_hwframe+0x46/0xb0

  kobject_add_internal failed for orangefs with -EEXIST, don't try to register things with the same name in the same directory.

Fixes: 2f83ace371 ("orangefs: put register_chrdev immediately before register_filesystem")
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:14:26 +01:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
dcache.c fs: orangefs: fix error return code of orangefs_revalidate_lookup() 2021-11-18 19:17:01 +01:00
devorangefs-req.c
dir.c
downcall.h
file.c Orangef: implement orangefs_readahead. 2021-04-28 07:33:04 -04:00
inode.c fs: add generic helper for filling statx attribute flags 2021-08-17 11:47:43 +02:00
Kconfig
Makefile
namei.c fs: make helpers idmap mount aware 2021-01-24 14:27:20 +01:00
orangefs-bufmap.c orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 2022-01-20 09:13:13 +01:00
orangefs-bufmap.h
orangefs-cache.c
orangefs-debug.h
orangefs-debugfs.c
orangefs-debugfs.h
orangefs-dev-proto.h
orangefs-kernel.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
orangefs-mod.c orangefs: Fix sysfs not cleanup when dev init failed 2022-12-31 13:14:26 +01:00
orangefs-sysfs.c
orangefs-sysfs.h
orangefs-utils.c orangefs_inode_is_stale(): i_mode type bits do *not* form a bitmap... 2021-03-12 22:15:17 -05:00
protocol.h
super.c orangefs: fix orangefs df output. 2021-06-28 08:40:08 -04:00
symlink.c
upcall.h
waitqueue.c
xattr.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00