[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNNEdbr+0p+PzinQ@infradead.org>
Date: Wed, 23 Jun 2021 15:25:57 +0100
From: Christoph Hellwig <hch@...radead.org>
To: Luca Boccassi <bluca@...ian.org>
Cc: Christoph Hellwig <hch@...radead.org>,
Matteo Croce <mcroce@...ux.microsoft.com>,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org,
Lennart Poettering <lennart@...ttering.net>,
Alexander Viro <viro@...iv.linux.org.uk>,
Damien Le Moal <damien.lemoal@....com>,
Tejun Heo <tj@...nel.org>,
Javier Gonz??lez <javier@...igon.com>,
Niklas Cassel <niklas.cassel@....com>,
Johannes Thumshirn <johannes.thumshirn@....com>,
Hannes Reinecke <hare@...e.de>,
Matthew Wilcox <willy@...radead.org>,
JeffleXu <jefflexu@...ux.alibaba.com>
Subject: Re: [PATCH v3 6/6] loop: increment sequence number
On Wed, Jun 23, 2021 at 02:13:25PM +0100, Luca Boccassi wrote:
> On Wed, 2021-06-23 at 12:57 +0100, Christoph Hellwig wrote:
> > On Wed, Jun 23, 2021 at 12:58:58PM +0200, Matteo Croce wrote:
> > > From: Matteo Croce <mcroce@...rosoft.com>
> > >
> > > On a very loaded system, if there are many events queued up from multiple
> > > attach/detach cycles, it's impossible to match them up with the
> > > LOOP_CONFIGURE or LOOP_SET_FD call, since we don't know where the position
> > > of our own association in the queue is[1].
> > > Not even an empty uevent queue is a reliable indication that we already
> > > received the uevent we were waiting for, since with multi-partition block
> > > devices each partition's event is queued asynchronously and might be
> > > delivered later.
> > >
> > > Increment the disk sequence number when setting or changing the backing
> > > file, so the userspace knows which backing file generated the event:
> >
> > Instead of manually incrementing the sequence here, can we make loop
> > generate the DISK_EVENT_MEDIA_CHANGE event on a backing device (aka
> > media) change?
>
> Hi,
>
> This was answered in the v1 thread:
>
> https://lore.kernel.org/linux-fsdevel/20210315201331.GA2577561@casper.infradead.org/t/#m8a677028572e826352cbb1e19d1b9c1f3b6bff4b
>
> The fundamental issue is that we'd be back at trying to correlate
> events to loopdev instances, which does not work reliably - hence this
> patch series. With the new ioctl, we can get the id immediately and
> without delay when we create the device, with no possible races. Then
> we can handle events reliably, as we can correlate correctly in all
> cases.
I very much disagree with your reply there. The device now points to
a different media. Both for the loop device, a floppy or a CD changer
probably by some kind of user action. In the last cast it might even
by done entirely locally through a script just like the loop device.
Powered by blists - more mailing lists