All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rustam Kovhaev <rkovhaev@gmail.com>
To: Hannes Reinecke <hare@suse.de>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: switch to pr_warn() in __device_add_disk()
Date: Sun, 11 Oct 2020 08:32:59 -0700	[thread overview]
Message-ID: <20201011153259.GA637021@thinkpad> (raw)
In-Reply-To: <745dd869-00ba-19fd-3643-27a92326f424@suse.de>

On Sun, Oct 11, 2020 at 04:53:22PM +0200, Hannes Reinecke wrote:
> On 10/11/20 3:03 PM, Rustam Kovhaev wrote:
> > syzbot triggered a warning while fuzzing with failslab fault injection
> > enabled
> > let's convert WARN_ON() to pr_warn()
> > 
> > Reported-and-tested-by: syzbot+f41893bb8c45cd18cf08@syzkaller.appspotmail.com
> > Link: https://syzkaller.appspot.com/bug?extid=f41893bb8c45cd18cf08
> > Signed-off-by: Rustam Kovhaev <rkovhaev@gmail.com>
> > ---
> >   block/genhd.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/block/genhd.c b/block/genhd.c
> > index 99c64641c314..be9ce35cf0fe 100644
> > --- a/block/genhd.c
> > +++ b/block/genhd.c
> > @@ -822,7 +822,8 @@ static void __device_add_disk(struct device *parent, struct gendisk *disk,
> >   		/* Register BDI before referencing it from bdev */
> >   		dev->devt = devt;
> >   		ret = bdi_register(bdi, "%u:%u", MAJOR(devt), MINOR(devt));
> > -		WARN_ON(ret);
> > +		if (ret)
> > +			pr_warn("%s: failed to register backing dev info\n", disk->disk_name);
> >   		bdi_set_owner(bdi, dev);
> >   		blk_register_region(disk_devt(disk), disk->minors, NULL,
> >   				    exact_match, exact_lock, disk);
> > 
> Please, don't. Where is the point in continuing here?
> I'd rather have it fixed up properly, either by having a return value to
> __device_add_disk() or by allowing the caller to check (eg by checking
> GENHD_FL_UP) if the call succeeded.
thank you for the review, it makes sense.


      reply	other threads:[~2020-10-11 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 13:03 [PATCH] block: switch to pr_warn() in __device_add_disk() Rustam Kovhaev
2020-10-11 14:53 ` Hannes Reinecke
2020-10-11 15:32   ` Rustam Kovhaev [this message]

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=20201011153259.GA637021@thinkpad \
    --to=rkovhaev@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.