Skip to contentSkip to conversation

metadata: skip MDA_IGNORED flags PV write metadata

PATCH New Yi Wang 1 participant 1 message Mar 13, 2023

lore
Share & tools
lore

Yi Wang

author
#0 lore raw

PATCH 1/1 metadata: skip MDA_IGNORED flags PV write metadata

From: Long YunJian <[email protected]>

If we set vgmetadatacopies value which less than PV available numbers in a VG, and use pvmetadataignore default 0, vgcreate save metadata to all pvs, included those set MDA_IGNORED flags PV. It is misleading into thinking that the set MDA_IGNORED PV is still in use. It also influence vgcreate performance in lots of PV environment. So, we add filter condition to avoid write metadata to those set MDA_IGNORED flags PV.

---
 lib/metadata/metadata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/metadata/metadata.c +1 -1
index 10af75665..7ca2e9f77 100644
@@ -3017,7 +3017,7 @@ int vg_write(struct volume_group *vg)
 	dm_list_iterate_items(mda, &vg->fid->metadata_areas_in_use) {
 		mda_dev = mda_get_device(mda);
 
-		if (mda->status & MDA_FAILED)
+		if (mda->status & MDA_FAILED || mda->status & MDA_IGNORED)
 			continue;
 
 		/*
Signature · 1 line
2.31.1