[PATCH V6 00/10] null_blk: fix init/exit races and memleaks

Zizhi Wo <[email protected]>
Newsgroups org.kernel.vger.linux-block
Message-ID <[email protected]>
From: Zizhi Wo <[email protected]>

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

See the individual patch descriptions for details.

Changes since v5:
- Add a new patch converting the file-scope mutex users to gaurd(mutex).
- Simplify the last two patches accordingly.
https://lore.kernel.org/all/[email protected]/

Changes since v4:
- Modified patch 5 to fix the check-and-deref race on dev->zones in
  zone_cond_store().
- Simplified the fix in patch 7.
https://lore.kernel.org/all/[email protected]/

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/[email protected]/

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/[email protected]/

Changes since v1:
- Added patches 4-6, and modify the lock name in patch 2.
https://lore.kernel.org/all/[email protected]/


Zizhi Wo (10):
  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: convert file-scope mutex users to guard(mutex)
  null_blk: serialize configfs attribute stores with the lock
  null_blk: serialize configfs attribute shows with the lock

 drivers/block/null_blk/main.c | 92 ++++++++++++++++-------------------
 1 file changed, 43 insertions(+), 49 deletions(-)

-- 
2.52.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.