Skip to content

Commit 8e4ff68

Browse files
Ming Leiaxboe
authored andcommitted
block: ublk: move ublk_chr_class destroying after devices are removed
The 'ublk_chr_class' is needed when deleting ublk char devices in ublk_exit(), so move it after devices(idle) are removed. Fixes the following warning reported by Harris, James R: [ 859.178950] sysfs group 'power' not found for kobject 'ublkc0' [ 859.178962] WARNING: CPU: 3 PID: 1109 at fs/sysfs/group.c:278 sysfs_remove_group+0x9c/0xb0 Reported-by: "Harris, James R" <[email protected]> Fixes: 71f28f3 ("ublk_drv: add io_uring based userspace block driver") Link: https://lore.kernel.org/linux-block/Y9JlFmSgDl3+zy3N@T590/T/#t Signed-off-by: Ming Lei <[email protected]> Tested-by: Jim Harris <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 955bc12 commit 8e4ff68

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/block/ublk_drv.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,13 +2092,12 @@ static void __exit ublk_exit(void)
20922092
struct ublk_device *ub;
20932093
int id;
20942094

2095-
class_destroy(ublk_chr_class);
2096-
2097-
misc_deregister(&ublk_misc);
2098-
20992095
idr_for_each_entry(&ublk_index_idr, ub, id)
21002096
ublk_remove(ub);
21012097

2098+
class_destroy(ublk_chr_class);
2099+
misc_deregister(&ublk_misc);
2100+
21022101
idr_destroy(&ublk_index_idr);
21032102
unregister_chrdev_region(ublk_chr_devt, UBLK_MINORS);
21042103
}

0 commit comments

Comments
 (0)