Skip to content

Add infrastructure for cleaner pv handling, v2

Dave Wysochanski lvm-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Add a couple of lvmcache functions to aid in lookups by pvname.lib/cache/lvmcache.c lib/cache/lvmcache.h+43 -00 replies
2/3Add find_vgname_from_pvname() function using lvmcache functions.lib/metadata/metadata-exported.h lib/metadata/metadata.c+43 -00 replies
2/3Add find_vgname_from_pvname() function using lvmcache functions.+0 -00 replies
3/3Update pvchange to always obtain a vg handle for each pv to process.tools/pvchange.c+46 -700 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Add infrastructure for cleaner pv handling, v2

This is the second version of the patchset that adds infrastructure to move us more towards the goal of removing the standalone PV object.

Quoted 1 line

From now on, a get/set of a PV property from the pvname requires

a lookup of the vgname, then a vg handle from the vgname, a pv from the vg handle, and finally using the pv handle to get/set the property.

The last patch reworks pvchange to use this new functionality. It passes the testsuite but does have at least one bug. A setup with a VG containing a PV with metadatacopies == 0 and pvchange -u --all end up failing because the PV is on both the orphan VG and the real VG. I tried a few ways of working around this, including processing the non-orphan VGs first, but I believe the root problem lies in the vg locking and lvmcache. The lvmcache gets invalidated after each vg lock change, so even if a PV with metadata copies was known to be in a real VG, once that lock is dropped the cache is invalidated and the PV shows up in the vg->pvs list for the orphan VG.