[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] LVM2/lib/metadata mirror.c



On Thu, Apr 23, 2009 at 04:43:02PM -0000, mornfall sourceware org wrote:
> 	A more thorough PV equality test (that also copes better with MISSING_PVs) in
> 	_is_mirror_image_removable.
 
>  			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;
>  				}
 
I'm not at all sure about this: what is your test case that requires the
id_equal() check and fails without it?

(Is there a danger it could match the wrong device, if, say, someone
cloned a PV?)

Alasdair
-- 
agk redhat com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]