linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@trained-monkey.org>
To: Blazej Kucman <blazej.kucman@intel.com>, linux-raid@vger.kernel.org
Subject: Re: [PATCH] imsm: fill working_disks according to metadata.
Date: Tue, 21 Jan 2020 13:42:26 -0500	[thread overview]
Message-ID: <2d196b56-cd44-dcea-8175-4fb257ba3ce4@trained-monkey.org> (raw)
In-Reply-To: <20200117142404.25035-1-blazej.kucman@intel.com>

On 1/17/20 9:24 AM, Blazej Kucman wrote:
> Imsm tracts as "working_disk" each visible drive.
> Assemble routine expects that the value will return count
> of active member drives recorded in metadata.
> As a side effect "--no-degraded" doesn't work correctly for imsm.
> Align this field to others.
> Added check, if the option --no-degraded is called with --scan.

I assume you meant tracks rather than tracts? I corrected this in the
description and applied this. If I was wrong, my apologies.

Thanks,
Jes


> Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
> ---
>  mdadm.c       | 9 ++++++---
>  super-intel.c | 5 ++---
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/mdadm.c b/mdadm.c
> index 256a97ef..13dc24e4 100644
> --- a/mdadm.c
> +++ b/mdadm.c
> @@ -1485,9 +1485,12 @@ int main(int argc, char *argv[])
>  			rv = Manage_stop(devlist->devname, mdfd, c.verbose, 0);
>  		break;
>  	case ASSEMBLE:
> -		if (devs_found == 1 && ident.uuid_set == 0 &&
> -		    ident.super_minor == UnSet && ident.name[0] == 0 &&
> -		    !c.scan ) {
> +		if (!c.scan && c.runstop == -1) {
> +			pr_err("--no-degraded not meaningful without a --scan assembly.\n");
> +			exit(1);
> +		} else if (devs_found == 1 && ident.uuid_set == 0 &&
> +			   ident.super_minor == UnSet && ident.name[0] == 0 &&
> +			   !c.scan) {
>  			/* Only a device has been given, so get details from config file */
>  			struct mddev_ident *array_ident = conf_get_ident(devlist->devname);
>  			if (array_ident == NULL) {
> diff --git a/super-intel.c b/super-intel.c
> index 5c1f759f..47809bc2 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -7946,7 +7946,8 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
>  				skip = 1;
>  			if (!skip && (ord & IMSM_ORD_REBUILD))
>  				recovery_start = 0;
> -
> +			if (!(ord & IMSM_ORD_REBUILD))
> +				this->array.working_disks++;
>  			/*
>  			 * if we skip some disks the array will be assmebled degraded;
>  			 * reset resync start to avoid a dirty-degraded
> @@ -7988,8 +7989,6 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
>  				else
>  					this->array.spare_disks++;
>  			}
> -			if (info_d->recovery_start == MaxSector)
> -				this->array.working_disks++;
>  
>  			info_d->events = __le32_to_cpu(mpb->generation_num);
>  			info_d->data_offset = pba_of_lba0(map);
> 

      reply	other threads:[~2020-01-21 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 14:24 [PATCH] imsm: fill working_disks according to metadata Blazej Kucman
2020-01-21 18:42 ` Jes Sorensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d196b56-cd44-dcea-8175-4fb257ba3ce4@trained-monkey.org \
    --to=jes@trained-monkey.org \
    --cc=blazej.kucman@intel.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).