On Wed, Oct 18, 2023 at 08:46:46AM +0200, Christoph Hellwig wrote: > On Wed, Oct 18, 2023 at 11:16:28AM +0800, Ming Lei wrote: > > On Tue, Oct 17, 2023 at 08:48:21PM +0200, Christoph Hellwig wrote: > > > 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. > > > > ->open() is called when opening bdev every times, and there can be > > existed openers, so not sure if it makes little sense here. > > Yes. It has to be a non-exclusive open, though, and how is that going > to help us with any general use case? If we really want to make the > media change notifications any useful we'd better just do the work > straight from the workqueue that polls for it. Given ->mark_dead() is added recently, userspace shouldn't depend on this behavior, so this patch looks fine: Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx> Thanks, Ming