Re: [PATCH 3/5] block: move bdev_mark_dead out of disk_check_media_change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux