Re: [md PATCH 4/6] md/raid5: change reshape-progress measurement to cope with reshaping backwards.

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

 



On 19:53, NeilBrown wrote:
> -			if (logical_sector >= conf->expand_progress) {
> +			if (mddev->delta_disks < 0
> +			    ? logical_sector < conf->reshape_progress
> +			    : logical_sector >= conf->reshape_progress) {
>  				disks = conf->previous_raid_disks;
>  				previous = 1;
>  			} else {
> -				if (logical_sector >= conf->expand_lo) {
> +				if (mddev->delta_disks < 0
> +				    ? logical_sector < conf->reshape_safe
> +				    : logical_sector >= conf->reshape_safe) {
>  					spin_unlock_irq(&conf->device_lock);
>  					schedule();
>  					goto retry;

Is it only me who finds such code hard to comprehend?  Given that
the patch adds checks of the form

	(delta < 0 && s < r) || (delta >= 0 && s >= r)

at several locations, it might make sense to introduce a marco or an
inline function for this check.

> +	/* reshape_progress is the leading edge of a 'reshape'
> +	 * It has value MaxSector when no expand is happening

s/expand/reshape

Regards
Andre
-- 
The only person who always got his work done by Friday was Robinson Crusoe

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux