OK, so it turns out that LVM is NOT zeroing any of the metadata outside
of the actual allocated fields in the on-disk structs. Since the on-disk
structs DO NOT include padding at the end, this means we leave garbage
like the DOS partition table signature on the disk. Yuck.
Likely places to fix this are:
- pv_setup_for_create(): zap the first few MB of the PV (and the end while
you are at it, to remove old MD RAID signatures). This is slow, and will
duplicate some of the I/O when writing the VGDA/PE tables, etc.
- pv_disk_t(): increase the size with padding at the end to LVM_PV_DISK_SIZE
You will need to do the same for all of the other on-disk structures.
You also need zero bytes from pe_on_disk.base + pe_total*sizeof(pe_disk_t)
to pe_on_disk.base + pe_on_disk.size. This is also a problem because the
LVM_PV_*_SIZE were changed, so the amount of padding is not constant.
- pv_write(): ugly since it adds constant overhead. This will be "handled"
if pv_disk_t() is increased in size.
Cheers, Andreas
-- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/