Re: [dm-devel] [PATCH] DM RAID: Add message/status support for changing sync action

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

 



On Fri, Mar 15, 2013 at 03:48:23PM -0500, Jon Brassow wrote:
> DM RAID:  Add message/status support for changing sync action
 
Quick points:

> Two additional fields 

(which are *always* populated)

> have been added 

appended

> to the status output to provide more
> information about the type of sync action occurring and the results of those
> actions, specifically: <sync_action> and <mismatch_cnt>.  This is essentially
> the device-mapper way of doing what MD controls through the 'sync_action'
> sysfs file and shows through the 'mismatch_cnt' sysfs file.
 
> +	char *sync_action_type = "idle";

(const?)  

> +		/*
> +		 * Sync action:
> +		 *   See Documentation/device-mapper/dm-raid.c for
> +		 *   information on each of these states.
> +		 */
> +		if (test_bit(MD_RECOVERY_FROZEN, &rs->md.recovery))
> +			sync_action_type = "frozen";
> +		else if (test_bit(MD_RECOVERY_RUNNING, &rs->md.recovery) ||
> +			 (!rs->md.ro && test_bit(MD_RECOVERY_NEEDED,
> +						 &rs->md.recovery))) {
> +			if (test_bit(MD_RECOVERY_RESHAPE, &rs->md.recovery))
> +				sync_action_type = "reshape";
> +			else if (test_bit(MD_RECOVERY_SYNC, &rs->md.recovery)) {
> +				if (!test_bit(MD_RECOVERY_REQUESTED,
> +					      &rs->md.recovery))
> +					sync_action_type = "resync";
> +				else if (test_bit(MD_RECOVERY_CHECK,
> +						  &rs->md.recovery))
> +					sync_action_type = "check";
> +				else
> +					sync_action_type = "repair";
> +			} else if (test_bit(MD_RECOVERY_RECOVER,
> +					    &rs->md.recovery))
> +				sync_action_type = "recover";
> +		}

Move this out into a fn that can simply return once it's selected
the most appropriate string?

> -	.version = {1, 4, 1},
> +	.version = {1, 4, 2},

  1.5.0 - inc minor when the change affects interface or behaviour in a non-neglible way

Alasdair

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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