public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Jiufei Xue <jiufei.xue@linux.alibaba.com>
Cc: hch@lst.de, Shaohua Li <shli@kernel.org>,
	Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, caspar@linux.alibaba.com,
	Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: Re: [PATCH 3/4] block: display the correct diskname for bio
Date: Mon, 26 Feb 2018 13:07:48 -0800	[thread overview]
Message-ID: <20180226210748.GC9157@vader.DHCP.thefacebook.com> (raw)
In-Reply-To: <675554d9-afdb-c7c5-1c5e-643002048d02@linux.alibaba.com>

On Mon, Feb 26, 2018 at 08:04:41PM +0800, Jiufei Xue wrote:
> bio_devname use __bdevname to display the device name, and can
> only show the major and minor of the part0.
> Fix this by using disk_name to display the correct name.

Besides adding a Fixes: tag like Jens said,

Reviewed-by: Omar Sandoval <osandov@fb.com>

> Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com>
> ---
>  block/partition-generic.c | 6 ++++++
>  include/linux/bio.h       | 4 +---
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/block/partition-generic.c b/block/partition-generic.c
> index 91622db..08dabcd 100644
> --- a/block/partition-generic.c
> +++ b/block/partition-generic.c
> @@ -51,6 +51,12 @@ const char *bdevname(struct block_device *bdev, char *buf)
>  
>  EXPORT_SYMBOL(bdevname);
>  
> +const char *bio_devname(struct bio *bio, char *buf)
> +{
> +	return disk_name(bio->bi_disk, bio->bi_partno, buf);
> +}
> +EXPORT_SYMBOL(bio_devname);
> +
>  /*
>   * There's very little reason to use this, you should really
>   * have a struct block_device just about everywhere and use
> diff --git a/include/linux/bio.h b/include/linux/bio.h
> index d0eb659..ce547a2 100644
> --- a/include/linux/bio.h
> +++ b/include/linux/bio.h
> @@ -511,6 +511,7 @@ extern struct bio *bio_copy_user_iov(struct request_queue *,
>  extern struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *);
>  extern void bvec_free(mempool_t *, struct bio_vec *, unsigned int);
>  extern unsigned int bvec_nr_vecs(unsigned short idx);
> +extern const char *bio_devname(struct bio *bio, char *buffer);
>  
>  #define bio_set_dev(bio, bdev) 			\
>  do {						\
> @@ -529,9 +530,6 @@ extern struct bio *bio_copy_user_iov(struct request_queue *,
>  #define bio_dev(bio) \
>  	disk_devt((bio)->bi_disk)
>  
> -#define bio_devname(bio, buf) \
> -	__bdevname(bio_dev(bio), (buf))
> -
>  #ifdef CONFIG_BLK_CGROUP
>  int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css);
>  void bio_disassociate_task(struct bio *bio);
> -- 
> 1.9.4
> 
> 

  reply	other threads:[~2018-02-26 21:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 12:01 [PATCH 0/4] fix a few problems in block layer Jiufei Xue
2018-02-26 12:04 ` [PATCH 1/4] block: fix the count of PGPGOUT for WRITE_SAME Jiufei Xue
2018-02-26 20:52   ` Omar Sandoval
2018-02-26 23:43   ` Bart Van Assche
2018-02-27  0:10   ` Christoph Hellwig
2018-02-26 12:04 ` [PATCH 2/4] block: bio_check_eod() needs to consider partition Jiufei Xue
2018-02-26 21:03   ` Omar Sandoval
2018-02-27  0:11   ` Christoph Hellwig
2018-02-27  4:51     ` Jiufei Xue
2018-02-26 12:04 ` [PATCH 3/4] block: display the correct diskname for bio Jiufei Xue
2018-02-26 21:07   ` Omar Sandoval [this message]
2018-02-26 12:04 ` [PATCH 4/4] block: fix a typo Jiufei Xue
2018-02-26 16:03 ` [PATCH 0/4] fix a few problems in block layer Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2018-02-27 12:07 [PATCH V2 " Jiufei Xue
2018-02-27 12:10 ` [PATCH 3/4] block: display the correct diskname for bio Jiufei Xue
2018-02-28 17:07   ` Christoph Hellwig

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=20180226210748.GC9157@vader.DHCP.thefacebook.com \
    --to=osandov@osandov.com \
    --cc=axboe@kernel.dk \
    --cc=caspar@linux.alibaba.com \
    --cc=hch@lst.de \
    --cc=jiufei.xue@linux.alibaba.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-block@vger.kernel.org \
    --cc=shli@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox