linux-next/fs/zonefs
Zhang Xiaoxu 4e45886956 zonefs: Fix race between modprobe and mount
There is a race between modprobe and mount as below:

 modprobe zonefs                | mount -t zonefs
--------------------------------|-------------------------
 zonefs_init                    |
  register_filesystem       [1] |
                                | zonefs_fill_super    [2]
  zonefs_sysfs_init         [3] |

1. register zonefs suceess, then
2. user can mount the zonefs
3. if sysfs initialize failed, the module initialize failed.

Then the mount process maybe some error happened since the module
initialize failed.

Let's register zonefs after all dependency resource ready. And
reorder the dependency resource release in module exit.

Fixes: 9277a6d4fb ("zonefs: Export open zone resource information through sysfs")
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
2022-11-22 14:18:32 +09:00
..
Kconfig zonefs: select CONFIG_CRC32 2021-01-04 09:06:42 +09:00
Makefile zonefs: Export open zone resource information through sysfs 2022-04-21 08:37:51 +09:00
super.c zonefs: Fix race between modprobe and mount 2022-11-22 14:18:32 +09:00
sysfs.c zonefs: Remove to_attr() helper function 2022-11-16 16:08:31 +09:00
trace.h fs/zonefs: Use the enum req_op type for tracing request operations 2022-07-14 12:14:33 -06:00
zonefs.h zonefs: Add active seq file accounting 2022-04-21 08:37:56 +09:00