[lvm-devel] LVM2/lib/metadata mirror.c

Petr Rockai prockai at redhat.com
Sun May 3 16:37:00 UTC 2009


(I was pretty sure I have sent this one already, but I can't find it now on the
list... re-sending in case it got lost somewhere...)

Alasdair G Kergon <agk at redhat.com> writes:
> I'm not at all sure about this: what is your test case that requires the
> id_equal() check and fails without it?
The testcase is that the sought-for PV is a MISSING_PV. This happens when
trying to repair a mirror: we are looking for a PV to remove and we certainly
want the missing one to be found to be removable. But we can't use pv->dev for
checking that, since there is no device associated to a MISSING_PV. So I have
guessed that UUID is the next best thing.

> (Is there a danger it could match the wrong device, if, say, someone
> cloned a PV?)
If the reading code will allow us to proceed with dup PVs, then yes, this could
happen. However, it seems to me that lvmcache_add will throw away any such dup
PVs (in lvmcache.c) -- and even if that path is not invoked, vg_validate will
reject any VG with a dup PV in it. Hopefully, that is robust enough.

Yours,
   Petr.

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation




More information about the lvm-devel mailing list