Skip to content

Avoid that blk_{un,}register_queue() trigger lock inversion

Bart Van Assche linux-block 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesIn review
  2. v13 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Restored the code that protects against races between changing the scheduler from sysfs and unregistering a block layer queue.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: Unexport elv_register_queue() and elv_unregister_queue()block/blk.h block/elevator.c include/linux/elevator.h+3 -41 reply
2/3block: Document scheduler modification locking requirementsblock/elevator.c+8 -01 reply
3/3block: Protect less code with sysfs_lock in blk_{un,}register_queue()block/blk-sysfs.c+28 -91 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] Avoid that blk_{un,}register_queue() trigger lock inversion

Hello Jens,

The three patches in this series are what I came up with after having analyzed a lockdep complaint triggered by blk_unregister_queue(). Please consider these patches for kernel v4.16.

Thanks,

Bart.

Changes compared to v1:
- Restored the code that protects against races between changing the scheduler from sysfs and unregistering a block layer queue.

Bart Van Assche (3):
block: Unexport elv_register_queue() and elv_unregister_queue()
block: Document scheduler modification locking requirements
block: Protect less code with sysfs_lock in blk_{un,}register_queue()

 block/blk-sysfs.c        | 37 ++++++++++++++++++++++++++++---------
 block/blk.h              |  3 +++
 block/elevator.c         | 10 ++++++++--
 include/linux/elevator.h |  2 --
 4 files changed, 39 insertions(+), 13 deletions(-)
Signature · 1 line
2.15.1