[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210715190726.xlukndxddvph4fx6@garbanzo>
Date: Thu, 15 Jul 2021 12:07:26 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: axboe@...nel.dk, hare@...e.de, bvanassche@....org,
ming.lei@...hat.com, jack@...e.cz, osandov@...com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 6/6] block: skip queue if NULL on blk_cleanup_queue()
On Thu, Jul 15, 2021 at 08:11:57AM +0100, Christoph Hellwig wrote:
> On Wed, Jul 14, 2021 at 09:55:31PM -0700, Luis Chamberlain wrote:
> > Now that error handling for add_disk*() calls is added, we must
> > accept a common form for when errors are detected on the the
> > add_disk*() calls, and that is to call blk_cleanup_disk() on
> > error always. One of the corner cases possible is a driver bug
> > where the queue is already gone and we cannot blk_get_queue(),
> > and so may be NULL. When blk_cleanup_disk() is called in this
> > case blk_cleanup_queue() will crash with a null dereference.
> >
> > Make this an accepted condition and just skip it. This allows us
> > to also test for it safely with error injection.
>
> So you plan to call blk_cleanup_disk when add_disk fails?
Yes, they can open code things if they wish as well, but when possible yes.
> For all drivers using blk_alloc_disk/blk_mq_alloc_disk there should
> always be a queue. The others ones aren't ready to handle errors
> from add_disk yet in any way I think (and I plan to fix this up
> ASAP).
Have an example in mind?
Luis
Powered by blists - more mailing lists