Thread (19 messages) flat view 19 messages, 3 authors, 2021-08-27

sort out the lock order in the loop driver v2

From: Christoph Hellwig <hch@lst.de>
Date: 2021-08-26 13:40:22

Hi Jens,

this series sorts out lock order reversals involving the block layer
open_mutex by drastically reducing the scope of loop_ctl_mutex.  To do
so it first merges the cryptoloop module into the main loop driver
as the unregistrtion of transfers on live loop devices was causing
some nasty locking interactions.

Changes since v1:
 - add a new patch to fix a pre-existing spare warning in the crypto code
 - initialize various struct loop_dev fields earlier
 - hold lo_mutex over lo_state updates
 - take loop_ctl_mutex to delete from the idr in the loop_add failure
   path

Diffstat:
 b/drivers/block/Kconfig    |    6 
 b/drivers/block/Makefile   |    1 
 b/drivers/block/loop.c     |  334 ++++++++++++++++++++++++---------------------
 b/drivers/block/loop.h     |   30 ----
 drivers/block/cryptoloop.c |  204 ---------------------------
 5 files changed, 189 insertions(+), 386 deletions(-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help