Re: the question about raid0_make_request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday June 19, liudows2@xxxxxxxxx wrote:
> We can imagine that there is a raid0 array whose layerout is drawn in the
> attachment.
> Take this for example.
> There are 3 zones totally, and their zone->nb_dev is 5,4,3 respectively.
> In the raid0_make_request function, the var block is the offset of bio in
> kilobytes.
> 
> 
>  x = block >> chunksize_bits;
>   tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
> 
> If block is in the chunk 5, then x = block >> chunksize_bits = 5.And the
> nb_dev of zone2 is 4.
> So tmp_dev = zone->dev[sector_div(5,4)] = zone->dev[1].
> But we can see that the right result should be zone->dev[0].
> Then how does the 'bug'  get the  right  underlying device?

When you say 'right' result, you really mean 'expected' result.

You expect the layout to be

   0   1   2   3   4
       5   6   7   8
           9   10  11

The actual layout for Linux-md-raid0 is

   0   1   2   3   4
       8   5   6   7
           9   10  11

Not what you would expect, but still a valid layout.

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux