From 3743a6858be4fdb1fe735884f1ea04862c361378 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Thu, 23 Apr 2009 16:43:01 +0000 Subject: [PATCH] A more thorough PV equality test (that also copes better with MISSING_PVs) in _is_mirror_image_removable. --- lib/metadata/mirror.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index c53aec3a3..5eb53f4df 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -440,7 +440,12 @@ static int _is_mirror_image_removable(struct logical_volume *mimage_lv, pv_found = 0; dm_list_iterate_items(pvl, removable_pvs) { - if (pv->dev->dev == pvl->pv->dev->dev) { + if (id_equal(&pv->id, &pvl->pv->id)) { + pv_found = 1; + break; + } + if (pvl->pv->dev && pv->dev && + pv->dev->dev == pvl->pv->dev->dev) { pv_found = 1; break; }