On 02/05/2016 10:15 AM, Gabriel Krisman Bertazi wrote:
> Detect when a RAID is going through initialization process after
> creation to display the progress in get_status.
> 
> Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
> ---
>  iprconfig.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/iprconfig.c b/iprconfig.c
> index 3189af0..9d0942d 100644
> --- a/iprconfig.c
> +++ b/iprconfig.c
> @@ -12689,6 +12689,7 @@ static void get_status(struct ipr_dev *dev, char 
> *buf, int percent, int path_sta
>       int percent_cmplt = 0;
>       int format_in_progress = 0;
>       int resync_in_progress = 0;
> +     int initialization_in_progress = 0;
>       struct ipr_res_redundancy_info info;
> 
>       if (scsi_dev_data && scsi_dev_data->type == IPR_TYPE_ADAPTER && dev == 
> &ioa->ioa) {
> @@ -12714,6 +12715,8 @@ static void get_status(struct ipr_dev *dev, char 
> *buf, int percent, int path_sta
>                                               continue;
>                                       if (status_record->command_code == 
> IPR_RESYNC_ARRAY_PROTECTION)
>                                               resync_in_progress = 1;
> +                                     if (status_record->command_code == 
> IPR_START_ARRAY_PROTECTION)
> +                                             initialization_in_progress = 1;
>                                       percent_cmplt = 
> status_record->percent_complete;
>                               }
>                       }
> @@ -12836,6 +12839,11 @@ static void get_status(struct ipr_dev *dev, char 
> *buf, int percent, int path_sta
>                                       sprintf(buf, "Checking");
>                               else
>                                       sprintf(buf, "%d%% Checked", 
> percent_cmplt);
> +                     } else if (initialization_in_progress) {
> +                             if ((!percent || (percent_cmplt == 0)))
> +                                     sprintf(buf, "Initializing");
> +                             else
> +                                     sprintf(buf, "%d%% Initializing", 
> percent_cmplt);

We'll need to make sure we update the SAS reference guide to document this as a 
valid state:

http://www-01.ibm.com/support/knowledgecenter/8247-22L/p8ebk/diskarraystates.htm?cp=8247-22L

What happens now if you create a single disk RAID 0 with a device not known to 
be zeroed? Does this now
display the Initializing status? If so, we might want to enhance the patch 
description to indicate this.

Thanks,

Brian


-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to