Linux block layer
 help / color / mirror / Atom feed
* [PATCH V4 0/9] null_blk: fix init/exit races and memleaks
@ 2026-07-09 10:04 Zizhi Wo
  2026-07-09 10:04 ` [PATCH V4 1/9] null_blk: use DEFINE_MUTEX for the file-scope mutex Zizhi Wo
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Zizhi Wo @ 2026-07-09 10:04 UTC (permalink / raw)
  To: axboe, dlemoal, nilay, kch, johannes.thumshirn, kbusch,
	bvanassche, linux-block
  Cc: linux-kernel, yangerkun, chengzhihao1, wozizhi

From: Zizhi Wo <wozizhi@huawei.com>

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

Patches 1-4 are unchanged from v3.
Patch 5 fixes another memory leak of the zones array, and patch 6 is a
related cleanup.
Patch 7 fixes a NULL-ptr-deref of hctx when shrinking submit_queues on a
device that shares the global tag_set.
Patch 8 fixes a data race, similar to patch 5 in v3, but adjusts the
return value handling.
Patch 9 serializes configfs attribute shows to close the remaining
show-vs-write races.

See the individual patch descriptions for details.

Changes since v3:
- Added patch 5 (zones array memleak) and patch 6 (cleanup).
- Added patch 7 (NULL-ptr-deref on shared tag_set queue shrink).
- Patch 9: reworked the fix from v3's patch 6 to take the file-scope
  lock in _store instead of scattering READ_ONCE/WRITE_ONCE.
https://lore.kernel.org/all/20260708073917.2172392-1-wozizhi@huaweicloud.com/

Changes since v2:
- Dropped the lock rename patch; the rename and locking rework will be
  sent as a separate series (per Damien's suggestion).
- Patch 3: fixed the tense in the commit message.
- Patch 4: also update dev->NAME in the "!dev->nullb" path, which was
  previously lost.
https://lore.kernel.org/all/20260707025542.1299859-1-wozizhi@huaweicloud.com/

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 (9):
  null_blk: use DEFINE_MUTEX for the file-scope mutex
  null_blk: register configfs subsystem after creating default devices
  null_blk: move unregister_blkdev() after destroying dev in null_exit()
  null_blk: free global tag_set on init error path
  null_blk: free zones array on device power-off
  null_blk: clean up null_del_dev() to use cached dev pointer
  null_blk: reject per-device queue resize for shared tag set
  null_blk: serialize configfs attribute stores with device setup
  null_blk: serialize configfs attribute shows with the file-scope lock

 drivers/block/null_blk/main.c | 79 +++++++++++++++++++----------------
 1 file changed, 44 insertions(+), 35 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2026-07-10 14:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 10:04 [PATCH V4 0/9] null_blk: fix init/exit races and memleaks Zizhi Wo
2026-07-09 10:04 ` [PATCH V4 1/9] null_blk: use DEFINE_MUTEX for the file-scope mutex Zizhi Wo
2026-07-10 12:35   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 2/9] null_blk: register configfs subsystem after creating default devices Zizhi Wo
2026-07-10 12:36   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 3/9] null_blk: move unregister_blkdev() after destroying dev in null_exit() Zizhi Wo
2026-07-10 12:36   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 4/9] null_blk: free global tag_set on init error path Zizhi Wo
2026-07-10 12:37   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 5/9] null_blk: free zones array on device power-off Zizhi Wo
2026-07-10 14:24   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 6/9] null_blk: clean up null_del_dev() to use cached dev pointer Zizhi Wo
2026-07-10 13:03   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 7/9] null_blk: reject per-device queue resize for shared tag set Zizhi Wo
2026-07-10 12:34   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 8/9] null_blk: serialize configfs attribute stores with device setup Zizhi Wo
2026-07-10 12:30   ` Nilay Shroff
2026-07-09 10:04 ` [PATCH V4 9/9] null_blk: serialize configfs attribute shows with the file-scope lock Zizhi Wo
2026-07-10 12:31   ` Nilay Shroff

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