[PATCH] metadata: skip MDA_IGNORED flags PV write metadata

Yi Wang <[email protected]>
Newsgroups gmane.linux.lvm.devel
Message-ID <[email protected]>
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.

Signed-off-by: Long YunJian <[email protected]>
Signed-off-by: Yi Wang <[email protected]>
---
 lib/metadata/metadata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 10af75665..7ca2e9f77 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -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;
 
 		/*
-- 
2.31.1

--
lvm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/lvm-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.