On Nov 11, 2011, at 10:23 AM, Zdenek Kabelac wrote:
Thanks for looking over the patches. You are right. If the flag is not permanent, the machine could fail after the vg_commit, but before the resume - resulting in the devices never being rebuilt.
The problem from the other side is that if the flag is permanent (is written to metadata), then the machine could crash after the resume has properly prep'ed the device for a rebuild but before clearing the flag for the next activation. This would result in the devices being rebuilt every time the LV is activated.
Perhaps I will work on some post processing for lvchange/vgchange, where certain flags are cleared after activation has been assured. Or perhaps a flag could be added to the VG on-disk metadata that would indicate transaction has failed part-way through.
I heard thinp is using generation numbers to allow the kernel to ignore commands it has already performed. However, this implies that the LVM metadata is somehow changed after the action is completed - otherwise it would simply redo these actions upon every activation. Perhaps I could align my code with that somehow?
In the mean time, I can make the flags so they are written to disk.