linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Guoqing Jiang <gqjiang@suse.com>
Cc: linux-raid@vger.kernel.org, neilb@suse.com
Subject: Re: [PATCH] md: clear WantReplacement once disk is removed
Date: Tue, 25 Apr 2017 09:36:07 -0700	[thread overview]
Message-ID: <20170425163607.x2ujyfp4esstm5ol@kernel.org> (raw)
In-Reply-To: <20170424075804.19103-1-gqjiang@suse.com>

On Mon, Apr 24, 2017 at 03:58:04PM +0800, Guoqing Jiang wrote:
> We can clear 'WantReplacement' flag directly no
> matter it's replacement existed or not since the
> semantic is same as before.
> 
> Also since the disk is removed from array, then
> it is straightforward to remove 'WantReplacement'
> flag and the comments in raid10/5 can be removed
> as well.

applied, thanks! 
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
> ---
>  drivers/md/raid1.c  | 6 +++---
>  drivers/md/raid10.c | 8 ++------
>  drivers/md/raid5.c  | 9 +++------
>  3 files changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 57611f4..e93dd50 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -1831,9 +1831,9 @@ static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
>  			p->rdev = repl;
>  			conf->mirrors[conf->raid_disks + number].rdev = NULL;
>  			unfreeze_array(conf);
> -			clear_bit(WantReplacement, &rdev->flags);
> -		} else
> -			clear_bit(WantReplacement, &rdev->flags);
> +		}
> +
> +		clear_bit(WantReplacement, &rdev->flags);
>  		err = md_integrity_register(mddev);
>  	}
>  abort:
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index acb3f46..72b2a9c 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -1874,13 +1874,9 @@ static int raid10_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
>  			   * but will never see neither -- if they are careful.
>  			   */
>  		p->replacement = NULL;
> -		clear_bit(WantReplacement, &rdev->flags);
> -	} else
> -		/* We might have just remove the Replacement as faulty
> -		 * Clear the flag just in case
> -		 */
> -		clear_bit(WantReplacement, &rdev->flags);
> +	}
>  
> +	clear_bit(WantReplacement, &rdev->flags);
>  	err = md_integrity_register(mddev);
>  
>  abort:
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 356cd9c..3d971e5 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -7603,15 +7603,12 @@ static int raid5_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
>  			   * but will never see neither - if they are careful
>  			   */
>  		p->replacement = NULL;
> -		clear_bit(WantReplacement, &rdev->flags);
>  
>  		if (!err)
>  			err = log_modify(conf, p->rdev, true);
> -	} else
> -		/* We might have just removed the Replacement as faulty-
> -		 * clear the bit just in case
> -		 */
> -		clear_bit(WantReplacement, &rdev->flags);
> +	}
> +
> +	clear_bit(WantReplacement, &rdev->flags);
>  abort:
>  
>  	print_raid5_conf(conf);
> -- 
> 2.10.0
> 

      reply	other threads:[~2017-04-25 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24  7:58 [PATCH] md: clear WantReplacement once disk is removed Guoqing Jiang
2017-04-25 16:36 ` Shaohua Li [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=20170425163607.x2ujyfp4esstm5ol@kernel.org \
    --to=shli@kernel.org \
    --cc=gqjiang@suse.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.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).