]> git.itanic.dy.fi Git - linux-stable/commit
block: move bdev_mark_dead out of disk_check_media_change
authorChristoph Hellwig <hch@lst.de>
Tue, 17 Oct 2023 18:48:21 +0000 (20:48 +0200)
committerChristian Brauner <brauner@kernel.org>
Sat, 28 Oct 2023 11:29:23 +0000 (13:29 +0200)
commit6e57236ed6e070607868da70fac3d52ae24e5417
treec8ded2d5e3ead036b4c91f89c02c7fe844a2af04
parent51b4cb4f3e2265cf8303ffd9a4f239ee3805d3ca
block: move bdev_mark_dead out of disk_check_media_change

disk_check_media_change is mostly called from ->open where it makes
little sense to mark the file system on the device as dead, as we
are just opening it.  So instead of calling bdev_mark_dead from
disk_check_media_change move it into the few callers that are not
in an open instance.  This avoid calling into bdev_mark_dead and
thus taking s_umount with open_mutex held.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231017184823.1383356-4-hch@lst.de
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christian Brauner <brauner@kernel.org>
block/bdev.c
block/disk-events.c
drivers/block/ataflop.c
drivers/block/floppy.c