Re: [PATCH] bio: ensure __bio_clone_fast copies bi_partno

hch
2017-11-17T17:18:04Z

On Fri, Nov 17, 2017 at 04:50:39PM +0000, Bart Van Assche wrote:
>
> How about the following class of assignments in drivers/md/raid1.c:
>
> mbio->bi_disk = (void *)conf->mirrors[i].rdev;
>
> Should these assignments perhaps be followed by a mbio->bi_partno assignment?

No. They assign a struct md_rdev to the bi_disk pointer, abusing it
for internal storage. They should not assign mbio->bi_partno.
Instead we should figure out a way to get rid of this.

>
> How about the following class of assignments in the NVMe code:
>
> bio->bi_disk = disk;
>
> Should these assignments perhaps be followed by a bio->bi_partno assignment?

No, the multipath code always works on whole namespaces, not partitions.