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

Re: [lvm-devel] [PATCH] Fix removal of multiple devices from a mirror.



On 12/17/2009 02:51 PM, Petr Rockai wrote:
> the code for removing mirror images, as it is, shifts the first failed
> leg twice and fails to shift the second failed one at all, which
> reorders the mirror image array in such a way that a wrong leg is
> removed as a result.

well the code is not easily readable for me.
but the fix seems correct.

> @@ -533,6 +533,7 @@ static int _remove_mirror_images(struct 
>  			    _is_mirror_image_removable(sub_lv, removable_pvs)) {
>  				if (!shift_mirror_images(mirrored_seg, s))
>  					return_0;
> +				s--; /* adjust counter after shifting */

uint32_t s;

if the s drops to max_uint here, it will skip to 0 in next loop.
well, another loop style is probably better...
but let's not complicate it now...

>  				new_area_count--;
>  			}
>  		}

ack.

Milan


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