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

Re: [linux-lvm] LVM2 on-disk layout



Tejas Sumant wrote:
> 3) Why the metadata inside MDA wraps around, instead of the offset
> pointing to the start of metadata?

Metadata updates run in two steps:

- write() saves the new metadata to new place (circular buffer)
but still keeping previous version active.
(Also operation can be safely reverted here, because there
are still old version of metadata prepared.)

- commit() switch the pointer to new offset and activate
new metadata. This operation is atomic (one synchronous sector write)
so it cannot corrupt active metadata copy.
(If the write fails, old metadata are still valid.)

(Imagine for example power failure during metadata write operation.)

There is serial number in metadata, lvm will update mda content to newest
metadata if any copies are older.


Milan
--
mbroz redhat com


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