Re: [lvm-devel] [PATCH] lvm2 support for detecting v1.x MD superblocks

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

 



On 10/23/07, Alasdair G Kergon <agk@xxxxxxxxxx> wrote:
> On Tue, Oct 23, 2007 at 11:32:56AM -0400, Mike Snitzer wrote:
> > I've tested the attached patch to work on MDs with v0.90.0, v1.0,
> > v1.1, and v1.2 superblocks.
>
> I'll apply this, thanks, but need to add comments (or reference) to explain
> what the hard-coded numbers are:
>
>         sb_offset = (size - 8 * 2) & ~(4 * 2 - 1);
> etc.

All values are in terms of sectors; so that is where the * 2 is coming
from.  The v1.0 case follows the same model as the MD_NEW_SIZE_SECTORS
which is used for v0.90.0.  The difference is that the v1.0 superblock
is found "at least 8K, but less than 12K, from the end of the device".

The same switch statement is used in mdadm and is accompanied with the
following comment:

        /*
         * Calculate the position of the superblock.
         * It is always aligned to a 4K boundary and
         * depending on minor_version, it can be:
         * 0: At least 8K, but less than 12K, from end of device
         * 1: At start of device
         * 2: 4K from start of device.
         */

Would it be sufficient to add that comment block above
v1_sb_offset()'s switch statement?

thanks,
Mike
-
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