All of lore.kernel.org
 help / color / mirror / Atom feed
From: weiping zhang <zhangweiping@didichuxing.com>
To: Jan Kara <jack@suse.cz>
Cc: <axboe@kernel.dk>, <linux-block@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH 4/4] block: add WARN_ON if bdi register fail
Date: Tue, 31 Oct 2017 18:34:53 +0800	[thread overview]
Message-ID: <20171031103453.GC1616@source.didichuxing.com> (raw)
In-Reply-To: <20171030131430.GJ23278@quack2.suse.cz>

On Mon, Oct 30, 2017 at 02:14:30PM +0100, Jan Kara wrote:
> On Fri 27-10-17 01:36:42, weiping zhang wrote:
> > device_add_disk need do more safety error handle, so this patch just
> > add WARN_ON.
> > 
> > Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
> > ---
> >  block/genhd.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/block/genhd.c b/block/genhd.c
> > index dd305c65ffb0..cb55eea821eb 100644
> > --- a/block/genhd.c
> > +++ b/block/genhd.c
> > @@ -660,7 +660,9 @@ void device_add_disk(struct device *parent, struct gendisk *disk)
> >  
> >  	/* Register BDI before referencing it from bdev */
> >  	bdi = disk->queue->backing_dev_info;
> > -	bdi_register_owner(bdi, disk_to_dev(disk));
> > +	retval = bdi_register_owner(bdi, disk_to_dev(disk));
> > +	if (retval)
> > +		WARN_ON(1);
> 
> Just a nit: You can do
> 
> 	WARN_ON(retval);
> 
> Otherwise you can add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>
> 
more claner, I'll apply at V2, Thanks

--
weiping

WARNING: multiple messages have this Message-ID (diff)
From: weiping zhang <zhangweiping@didichuxing.com>
To: Jan Kara <jack@suse.cz>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 4/4] block: add WARN_ON if bdi register fail
Date: Tue, 31 Oct 2017 18:34:53 +0800	[thread overview]
Message-ID: <20171031103453.GC1616@source.didichuxing.com> (raw)
In-Reply-To: <20171030131430.GJ23278@quack2.suse.cz>

On Mon, Oct 30, 2017 at 02:14:30PM +0100, Jan Kara wrote:
> On Fri 27-10-17 01:36:42, weiping zhang wrote:
> > device_add_disk need do more safety error handle, so this patch just
> > add WARN_ON.
> > 
> > Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
> > ---
> >  block/genhd.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/block/genhd.c b/block/genhd.c
> > index dd305c65ffb0..cb55eea821eb 100644
> > --- a/block/genhd.c
> > +++ b/block/genhd.c
> > @@ -660,7 +660,9 @@ void device_add_disk(struct device *parent, struct gendisk *disk)
> >  
> >  	/* Register BDI before referencing it from bdev */
> >  	bdi = disk->queue->backing_dev_info;
> > -	bdi_register_owner(bdi, disk_to_dev(disk));
> > +	retval = bdi_register_owner(bdi, disk_to_dev(disk));
> > +	if (retval)
> > +		WARN_ON(1);
> 
> Just a nit: You can do
> 
> 	WARN_ON(retval);
> 
> Otherwise you can add:
> 
> Reviewed-by: Jan Kara <jack@suse.cz>
> 
more claner, I'll apply at V2, Thanks

--
weiping

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-10-31 10:34 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26 17:35 [PATCH 0/4] add error handle for bdi debugfs register weiping zhang
2017-10-26 17:35 ` weiping zhang
2017-10-26 17:35 ` [PATCH 1/4] bdi: add check for bdi_debug_root weiping zhang
2017-10-26 17:35   ` weiping zhang
2017-10-30 13:00   ` Jan Kara
2017-10-30 13:00     ` Jan Kara
2017-10-31 10:30     ` weiping zhang
2017-10-31 10:30       ` weiping zhang
2017-10-26 17:35 ` [PATCH 2/4] bdi: convert bdi_debug_register to int weiping zhang
2017-10-26 17:35   ` weiping zhang
2017-10-30 13:01   ` Jan Kara
2017-10-30 13:01     ` Jan Kara
2017-10-26 17:36 ` [PATCH 3/4] bdi: add error handle for bdi_debug_register weiping zhang
2017-10-26 17:36   ` weiping zhang
2017-10-30 13:10   ` Jan Kara
2017-10-30 13:10     ` Jan Kara
2017-10-31 10:33     ` weiping zhang
2017-10-31 10:33       ` weiping zhang
2017-10-26 17:36 ` [PATCH 4/4] block: add WARN_ON if bdi register fail weiping zhang
2017-10-26 17:36   ` weiping zhang
2017-10-30 13:14   ` Jan Kara
2017-10-30 13:14     ` Jan Kara
2017-10-31 10:34     ` weiping zhang [this message]
2017-10-31 10:34       ` weiping zhang

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=20171031103453.GC1616@source.didichuxing.com \
    --to=zhangweiping@didichuxing.com \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.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.