]> git.baikalelectronics.ru Git - kernel.git/commit
loop: suppress uevents while reconfiguring the device
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Mar 2022 05:29:14 +0000 (07:29 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 12:54:09 +0000 (06:54 -0600)
commitcb52fff995d2aaf2c23ba3a731d7616a112b0982
tree55dbf452df24fc47b92d19ac21651af9ca29fc8a
parent4db63e5f618c15866437c26636f9e840aca8ae0a
loop: suppress uevents while reconfiguring the device

Currently, udev change event is generated for a loop device before the
device is ready for IO. Due to serialization on lo->lo_mutex in
lo_open() this does not matter because anybody is able to open the
device and do IO only after the configuration is finished. However this
synchronization in lo_open() is going away so make sure userspace
reacting to the change event will see the new device state by generating
the event only when the device is setup.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220330052917.2566582-13-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c