Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH] block: always set partition number to '0' in blk_partition_remap()
Date: Wed, 6 Jun 2018 16:36:23 +0200	[thread overview]
Message-ID: <20180606163623.7d8d456b@pentland.suse.de> (raw)
In-Reply-To: <25f0db7b-ccac-88f6-76e7-99d1b94e11f9@kernel.dk>

On Wed, 6 Jun 2018 08:26:56 -0600
Jens Axboe <axboe@kernel.dk> wrote:

> On 6/6/18 8:22 AM, Hannes Reinecke wrote:
> > blk_partition_remap() will only clear bi_partno if an actual
> > remapping has happened. But flush request et al don't have an
> > actual size, so the remapping doesn't happen and bi_partno is never
> > cleared. So for stacked devices blk_partition_remap() will be
> > called on each level. If (as is the case for native nvme
> > multipathing) one of the lower-level devices do _not_support
> > partitioning a spurious I/O error is generated.  
> 
> Just move it down, we're now clearing it for both cases.
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 3f56be15f17e..cf0ee764b908 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -2220,10 +2220,10 @@ static inline int blk_partition_remap(struct
> bio *bio) if (bio_check_eod(bio, part_nr_sects_read(p)))
>  			goto out;
>  		bio->bi_iter.bi_sector += p->start_sect;
> -		bio->bi_partno = 0;
>  		trace_block_bio_remap(bio->bi_disk->queue, bio,
> part_devt(p), bio->bi_iter.bi_sector - p->start_sect);
>  	}
> +	bio->bi_partno = 0;
>  	ret = 0;
>  out:
>  	rcu_read_unlock();
> 

Okay, will be resending.

Cheers,

Hannes

  reply	other threads:[~2018-06-06 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 14:22 [PATCH] block: always set partition number to '0' in blk_partition_remap() Hannes Reinecke
2018-06-06 14:26 ` Jens Axboe
2018-06-06 14:36   ` Hannes Reinecke [this message]
2018-06-06 14:42   ` 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=20180606163623.7d8d456b@pentland.suse.de \
    --to=hare@suse.de \
    /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