The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH V2 0/6] null_blk: fix init/exit races, leaks and cleanup
@ 2026-07-07  2:55 Zizhi Wo
  2026-07-07  2:55 ` [PATCH V2 1/6] null_blk: use DEFINE_MUTEX for the file-scope mutex Zizhi Wo
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Zizhi Wo @ 2026-07-07  2:55 UTC (permalink / raw)
  To: axboe, dlemoal, nilay, linux-block, kch, johannes.thumshirn,
	kbusch, bvanassche
  Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi

This series fixes several issues in null_blk around lock initialization,
concurrent configfs access, and module init/exit cleanup.

Patches 1-2 fix the uninitialized mutex. Following Bart's suggestion, the
fix now uses DEFINE_MUTEX() and renames the lock.

Patch 3 fixes configfs registration concurrency.

Patch 4 reorders resource release in null_exit() to match null_init().

Patch 5 fixes a data race where the NULLB_DEVICE_ATTR macro locklessly
overwrote dev state already set under the lock by apply_fn().

Patch 6 fixes a global tag_set leak on the null_init() error path.

See the individual patch descriptions for details.

Changes since v1:
- Added patches 4-6, and modify the lock name in patch 2.
https://lore.kernel.org/all/20260706123507.3809871-1-wozizhi@huaweicloud.com/

Zizhi Wo (6):
  null_blk: use DEFINE_MUTEX for the file-scope mutex
  null_blk: give the file-scope mutex a descriptive name
  null_blk: register configfs subsystem after creating default devices
  null_blk: move unregister_blkdev() after destroying dev in null_exit()
  null_blk: don't locklessly overwrite dev state after apply_fn
  null_blk: free global tag_set on init error path

 drivers/block/null_blk/main.c | 70 +++++++++++++++++------------------
 1 file changed, 34 insertions(+), 36 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-07-07  8:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07  2:55 [PATCH V2 0/6] null_blk: fix init/exit races, leaks and cleanup Zizhi Wo
2026-07-07  2:55 ` [PATCH V2 1/6] null_blk: use DEFINE_MUTEX for the file-scope mutex Zizhi Wo
2026-07-07  4:07   ` Damien Le Moal
2026-07-07  2:55 ` [PATCH V2 2/6] null_blk: give the file-scope mutex a descriptive name Zizhi Wo
2026-07-07  4:16   ` Damien Le Moal
2026-07-07  6:24     ` Zizhi Wo
2026-07-07  6:28       ` Damien Le Moal
2026-07-07  6:45         ` Zizhi Wo
2026-07-07  2:55 ` [PATCH V2 3/6] null_blk: register configfs subsystem after creating default devices Zizhi Wo
2026-07-07  4:18   ` Damien Le Moal
2026-07-07  2:55 ` [PATCH V2 4/6] null_blk: move unregister_blkdev() after destroying dev in null_exit() Zizhi Wo
2026-07-07  4:19   ` Damien Le Moal
2026-07-07  2:55 ` [PATCH V2 5/6] null_blk: don't locklessly overwrite dev state after apply_fn Zizhi Wo
2026-07-07  3:38   ` Zizhi Wo
2026-07-07  4:21   ` Damien Le Moal
2026-07-07  7:33   ` Nilay Shroff
2026-07-07  8:24     ` Zizhi Wo
2026-07-07  2:55 ` [PATCH V2 6/6] null_blk: free global tag_set on init error path Zizhi Wo
2026-07-07  4:24   ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox