Re: WARNING in block layer triggered in 3.17-rc3

From: Tejun Heo
Date: Mon Sep 08 2014 - 21:20:13 EST


Hello,

On Mon, Sep 08, 2014 at 01:42:44PM -0400, Alan Stern wrote:
> > This looks like a nasty hack. In theory the QUEUE_FLAG_INIT_DONE should
> > be unset on blk_unregister_queue() to match the teardown; it's only
> > accident it isn't. del_gendisk() in sd_remove() is supposed to tear a
> > lot of queue stuff down.
>
> It's not clear what the operative assumptions are. The comment in
> blk_register_queue() implies that bypass is active only because it was
> set up that way when the queue was created. The fact that
> blk_unregister_queue() doesn't call blk_queue_bypass_start() seems to
> support this view -- although it could also be a simple oversight.
>
> Hopefully Tejun can clear this iup.

Maintaining the initial bypass till queue registration is an
optimization because shutting down a fully functional queue is a
costly operation and there are drivers which set and destroy queues
repeatedly while probing, so, yeah, it's really a special case for
when the queue is being registered for the first time.

> > Your hack seems to indicate that this doesn't work on the add->del->add
> > transtion of a gendisk.
>
> Indeed, it does not work.

As such, the change you suggested makes perfect sense to me. Why
wouldn't it work?

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/