From: Luis Chamberlain <mcgrof@kernel.org>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: axboe@kernel.dk, hch@lst.de, linux-block@vger.kernel.org
Subject: Re: [PATCH 1/2] block: make __register_blkdev() return an error
Date: Sun, 5 Sep 2021 11:11:35 -0700 [thread overview]
Message-ID: <YTUIV0mSJHfgtMov@bombadil.infradead.org> (raw)
In-Reply-To: <9b9e8bfd-a2a6-4b78-413b-7c6c7eb83e05@I-love.SAKURA.ne.jp>
On Sat, Sep 04, 2021 at 11:49:06AM +0900, Tetsuo Handa wrote:
> On 2021/09/04 10:39, Luis Chamberlain wrote:
> > diff --git a/fs/block_dev.c b/fs/block_dev.c
> > index 45df6cbccf12..81a4738910a8 100644
> > --- a/fs/block_dev.c
> > +++ b/fs/block_dev.c
> > @@ -1144,10 +1144,13 @@ struct block_device *blkdev_get_no_open(dev_t dev)
> > {
> > struct block_device *bdev;
> > struct inode *inode;
> > + int ret;
> >
> > inode = ilookup(blockdev_superblock, dev);
> > if (!inode) {
> > - blk_request_module(dev);
> > + ret = blk_request_module(dev);
> > + if (ret)
> > + return NULL;
>
> Since e.g. loop_add() from loop_probe() returns -EEXIST when /dev/loop$num already
> exists (e.g. raced with ioctl(LOOP_CTL_ADD)), isn't unconditionally failing an over-failing?
It's not clear to me how. What do we loose by capturing the failure on
blk_request_module()?
Luis
next prev parent reply other threads:[~2021-09-05 18:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-04 1:39 [PATCH 0/2] block: 7th -- last batch of add_disk() error handling conversions Luis Chamberlain
2021-09-04 1:39 ` [PATCH 1/2] block: make __register_blkdev() return an error Luis Chamberlain
2021-09-04 2:49 ` Tetsuo Handa
2021-09-04 4:14 ` Jens Axboe
2021-09-05 18:11 ` Luis Chamberlain [this message]
2021-09-06 5:59 ` Tetsuo Handa
2021-09-07 14:57 ` Luis Chamberlain
2021-09-07 15:23 ` Tetsuo Handa
2021-09-07 15:28 ` Luis Chamberlain
2021-09-08 14:00 ` Luis Chamberlain
2021-09-04 1:39 ` [PATCH 2/2] block: add __must_check for *add_disk*() callers Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YTUIV0mSJHfgtMov@bombadil.infradead.org \
--to=mcgrof@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).