[lvm-devel] [PATCH] Avoid scanning all pvs in the system if pvcreating on a device with mdas.

Dave Wysochanski dwysocha at redhat.com
Wed Mar 17 17:32:27 UTC 2010


On Wed, 2010-03-17 at 11:17 +0100, Petr Rockai wrote:
> Hi,
> 
> Dave Wysochanski <dwysocha at redhat.com> writes:
> > Other areas of the code check whether there are mdas on an orphan pv before
> > doing the expensive scan of the system.  This patch adds this check to pvcreate
> > as well, and so will avoid the unnecessary scan if pvcreate on a device that
> > is an orphan PV.
> Looks OK to me. As far as I can tell, it should never happen that the
> metadata is out-of-date and we overwrite a non-orphan PV mistakenly.
> 
> This would require that the metadata on the PV claim this is an orphan
> but a newer copy of the metadata elsewhere claims this is part of a
> VG. That would mean that vgextend (or similar) failed to update the
> metadata on the new PV, which would presumably lead to overall vgextend
> failure and no new metadata on the pre-existing PVs either. So this
> should be safe.
> 

Ok - turns out I should have searched more carefully as there are more
instances where we could save the scanning.

I'll work on an updated patch.






More information about the lvm-devel mailing list