lkml.org 
[lkml]   [2021]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 2/3] block: add bdev_interposer
On Tue, Mar 16 2021 at 11:03pm -0400,
Ming Lei <ming.lei@redhat.com> wrote:

> On Tue, Mar 16, 2021 at 07:35:44PM +0300, Sergei Shtepa wrote:
> > The 03/16/2021 11:09, Ming Lei wrote:
> > > On Fri, Mar 12, 2021 at 06:44:54PM +0300, Sergei Shtepa wrote:
> > > > bdev_interposer allows to redirect bio requests to another devices.
> > > >
> > > > Signed-off-by: Sergei Shtepa <sergei.shtepa@veeam.com>

...

> > > > +
> > > > +int bdev_interposer_attach(struct block_device *original,
> > > > + struct block_device *interposer)
> > > > +{
> > > > + int ret = 0;
> > > > +
> > > > + if (WARN_ON(((!original) || (!interposer))))
> > > > + return -EINVAL;
> > > > + /*
> > > > + * interposer should be simple, no a multi-queue device
> > > > + */
> > > > + if (!interposer->bd_disk->fops->submit_bio)
> > > > + return -EINVAL;
> > > > +
> > > > + if (WARN_ON(!blk_mq_is_queue_frozen(original->bd_disk->queue)))
> > > > + return -EPERM;
> > >
> > > The original request queue may become live now...
> >
> > Yes.
> > I will remove the blk_mq_is_queue_frozen() function and use a different
> > approach.
>
> Looks what attach and detach needs is that queue is kept as frozen state
> instead of being froze simply at the beginning of the two functions, so
> you can simply call freeze/unfreeze inside the two functions.
>
> But what if 'original' isn't a MQ queue? queue usage counter is just
> grabed when calling ->submit_bio(), and queue freeze doesn't guarantee there
> isn't any io activity, is that a problem for bdev_interposer use case?

Right, I raised the same concern here:
https://listman.redhat.com/archives/dm-devel/2021-March/msg00135.html
(toward bottom inlined after dm_disk_{freeze,unfreeze}

Anyway, this certainly needs to be addressed.

Mike

\
 
 \ /
  Last update: 2021-03-17 17:18    [W:0.796 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site