linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
	ed.ciechanowski@intel.com, wojciech.neubauer@intel.com
Subject: Re: [PATCH 06/13] imsm: FIX: update disks status in container_contents()
Date: Wed, 12 Jan 2011 15:14:00 +1100	[thread overview]
Message-ID: <20110112151400.6ddab5a7@notabene.brown> (raw)
In-Reply-To: <20110110112815.10776.44824.stgit@gklab-128-013.igk.intel.com>

On Mon, 10 Jan 2011 12:28:15 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:

> Based on status information disks are added to array during grow (in reshape_array()).
> This information currently is not present and all disks (old and new) were added to md.
> To avoid adding already present disks, disk.state has to be set.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
> 
>  super-intel.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/super-intel.c b/super-intel.c
> index 9687993..2700401 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -4541,6 +4541,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
>  	for (i = 0; i < mpb->num_raid_devs; i++) {
>  		struct imsm_dev *dev;
>  		struct imsm_map *map;
> +		struct imsm_map *map2;
>  		struct mdinfo *this;
>  		int slot;
>  		char *ep;
> @@ -4551,6 +4552,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
>  
>  		dev = get_imsm_dev(super, i);
>  		map = get_imsm_map(dev, 0);
> +		map2 = get_imsm_map(dev, 1);
>  
>  		/* do not publish arrays that are in the middle of an
>  		 * unsupported migration
> @@ -4632,7 +4634,8 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
>  			info_d->disk.minor = d->minor;
>  			info_d->disk.raid_disk = slot;
>  			info_d->recovery_start = recovery_start;
> -
> +			if (map2 && (map2->num_members > slot))
> +				info_d->disk.state = (1 << MD_DISK_ACTIVE);
>  			if (info_d->recovery_start == MaxSector)
>  				this->array.working_disks++;
>  


This patch looks a little odd.  It should still be setting disk.state even if
map2 == NULL.

The real problem here is simply that container_content isn't setting
disk.state properly.

I have change the patch to the following which should be closed to correct.

NeilBrown


commit 86e3692b06f255ead5c290288f0fe9318f75440d
Author: Adam Kwolek <adam.kwolek@intel.com>
Date:   Wed Jan 12 15:12:44 2011 +1100

    imsm: FIX: update disks status in container_contents()
    
    Based on status information disks are added to array during grow (in reshape_array()).
    This information currently is not present and all disks (old and new) were added to md.
    To avoid adding already present disks, disk.state has to be set.
    
    Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
    Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/super-intel.c b/super-intel.c
index d62e6b7..f158163 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -4541,6 +4541,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
 	for (i = 0; i < mpb->num_raid_devs; i++) {
 		struct imsm_dev *dev;
 		struct imsm_map *map;
+		struct imsm_map *map2;
 		struct mdinfo *this;
 		int slot;
 		char *ep;
@@ -4551,6 +4552,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
 
 		dev = get_imsm_dev(super, i);
 		map = get_imsm_map(dev, 0);
+		map2 = get_imsm_map(dev, 1);
 
 		/* do not publish arrays that are in the middle of an
 		 * unsupported migration
@@ -4632,7 +4634,13 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra
 			info_d->disk.minor = d->minor;
 			info_d->disk.raid_disk = slot;
 			info_d->recovery_start = recovery_start;
-
+			if (map2) {
+				if (slot < map2->num_members)
+					info_d->disk.state = (1 << MD_DISK_ACTIVE);
+			} else {
+				if (slot < map->num_members)
+					info_d->disk.state = (1 << MD_DISK_ACTIVE);
+			}
 			if (info_d->recovery_start == MaxSector)
 				this->array.working_disks++;
 


  reply	other threads:[~2011-01-12  4:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 11:27 [PATCH 00/13] OLCE for external meta Raid5/single array Adam Kwolek
2011-01-10 11:27 ` [PATCH 01/13] Manage reshape process in manage_reshape vector Adam Kwolek
2011-01-12  3:51   ` NeilBrown
2011-01-10 11:27 ` [PATCH 02/13] imsm: FIX: allow for container reshape any unset size value Adam Kwolek
2011-01-12  3:52   ` NeilBrown
2011-01-12  8:32     ` Kwolek, Adam
2011-01-12 10:43       ` NeilBrown
2011-01-10 11:27 ` [PATCH 03/13] imsm: FIX: when monitor is active post update Adam Kwolek
2011-01-12  3:56   ` NeilBrown
2011-01-10 11:27 ` [PATCH 04/13] FIX: load anchor to get all information Adam Kwolek
2011-01-12  3:58   ` NeilBrown
2011-01-10 11:28 ` [PATCH 05/13] msm: FIX: when mdadm reloads anchor not need for local modyfication Adam Kwolek
2011-01-10 11:28 ` [PATCH 06/13] imsm: FIX: update disks status in container_contents() Adam Kwolek
2011-01-12  4:14   ` NeilBrown [this message]
2011-01-10 11:28 ` [PATCH 07/13] FIX: wrong flags are passed to function Adam Kwolek
2011-01-10 11:28 ` [PATCH 08/13] FIX/WORKAROUND: added disks are not used by reshape process /md/ Adam Kwolek
2011-01-12  4:39   ` NeilBrown
2011-01-10 11:28 ` [PATCH 09/13] Finalize reshape after adding disks to array Adam Kwolek
2011-01-12  4:52   ` NeilBrown
2011-01-10 11:28 ` [PATCH 10/13] FIX: Cannot unmount array after reshape Adam Kwolek
2011-01-12  4:53   ` NeilBrown
2011-01-12 15:12     ` Kwolek, Adam
2011-01-10 11:28 ` [PATCH 11/13] FIX/WORKAROUND: Arrays cannot be opened exclusively Adam Kwolek
2011-01-10 11:29 ` [PATCH 12/13] FIX: parity disks use for redundant levels only Adam Kwolek
2011-01-12  4:59   ` NeilBrown
2011-01-10 11:29 ` [PATCH 13/13] FIX: Fill sys_name for disk add Adam Kwolek
2011-01-12  5:02   ` NeilBrown

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=20110112151400.6ddab5a7@notabene.brown \
    --to=neilb@suse.de \
    --cc=adam.kwolek@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=wojciech.neubauer@intel.com \
    /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).