Incorrect length on via raid

Phillip Susi psusi at cfl.rr.com
Wed Oct 18 03:56:15 UTC 2006


I have been studying the source and I believe I have found the cause of 
the problem.  dm_raid0() in activate.c searches for the smallest disk in 
the set, then computes the total set size as the size of that smallest 
disk times the number of disks.  When calling _smallest() to find the 
size of the smallest disk, the full size of the entire disk is used 
rather than the size of the portion that is used by the array.

The VIA metadata contains the size of the entire array, so I wonder why 
it is being computed in the first place by dm_raid0(), instead of just 
using the value from the metadata.  Is it because other metadata formats 
contain the size of space used on the disk rather than the total size of 
the volume?

Is via_check() always called after all the devices have been scanned, 
but before any other activity?  Could this function, knowing the number 
of disks in the complete set, and the total size of the set according to 
the metadata, compute the number of used sectors on each disk and update 
the sectors field in the raid_dev's to reflect the number of used 
sectors, instead of total sectors on the device?


Phillip Susi wrote:
> I have a via raid0 and with newer kernels dmraid fails to set up the 
> table because the device mapper refuses to accept stripe tables that 
> have a length that is not an even multiple of the stripe width.  I 
> believe that all versions of dmraid up to and including rc12-pre1 
> incorrectly set the length on my system, but the on disk metadata 
> appears to contain the proper length.
> 
> dmraid -n output shows:
> 
> 0x006 array.capacity_low: 72303744
> 
> But dmsetup table shows:
> 
> via_hfciifae: 0 144607678 striped 2 128 8:0 0 8:16 0
> 
> The total length should be 144607488 sectors, not 144607678.
> 




More information about the Ataraid-list mailing list