linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "md: When RAID5 is dirty, force reconstruct-write instead of read-modify-write."
@ 2015-02-18  0:14 Jes.Sorensen
  2015-02-18  1:08 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Jes.Sorensen @ 2015-02-18  0:14 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, Jes Sorensen

From: Jes Sorensen <Jes.Sorensen@redhat.com>

This reverts commit a7854487cd7128a30a7f4f5259de9f67d5efb95f.

The above patch would cause lockups of RAID4/5 arrays if a drive is
going faulty during reconstruction.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 drivers/md/raid5.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index aa76865..bc3a085 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3159,25 +3159,12 @@ static void handle_stripe_dirtying(struct r5conf *conf,
 				   int disks)
 {
 	int rmw = 0, rcw = 0, i;
-	sector_t recovery_cp = conf->mddev->recovery_cp;
-
-	/* RAID6 requires 'rcw' in current implementation.
-	 * Otherwise, check whether resync is now happening or should start.
-	 * If yes, then the array is dirty (after unclean shutdown or
-	 * initial creation), so parity in some stripes might be inconsistent.
-	 * In this case, we need to always do reconstruct-write, to ensure
-	 * that in case of drive failure or read-error correction, we
-	 * generate correct data from the parity.
-	 */
-	if (conf->max_degraded == 2 ||
-	    (recovery_cp < MaxSector && sh->sector >= recovery_cp)) {
-		/* Calculate the real rcw later - for now make it
+	if (conf->max_degraded == 2) {
+		/* RAID6 requires 'rcw' in current implementation
+		 * Calculate the real rcw later - for now fake it
 		 * look like rcw is cheaper
 		 */
 		rcw = 1; rmw = 2;
-		pr_debug("force RCW max_degraded=%u, recovery_cp=%llu sh->sector=%llu\n",
-			 conf->max_degraded, (unsigned long long)recovery_cp,
-			 (unsigned long long)sh->sector);
 	} else for (i = disks; i--; ) {
 		/* would I have to read this buffer for read_modify_write */
 		struct r5dev *dev = &sh->dev[i];
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Revert "md: When RAID5 is dirty, force reconstruct-write instead of read-modify-write."
  2015-02-18  0:14 [PATCH] Revert "md: When RAID5 is dirty, force reconstruct-write instead of read-modify-write." Jes.Sorensen
@ 2015-02-18  1:08 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2015-02-18  1:08 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid

Jes.Sorensen@redhat.com writes:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> This reverts commit a7854487cd7128a30a7f4f5259de9f67d5efb95f.
>
> The above patch would cause lockups of RAID4/5 arrays if a drive is
> going faulty during reconstruction.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
>  drivers/md/raid5.c | 19 +++----------------
>  1 file changed, 3 insertions(+), 16 deletions(-)

Please ignore this one - per previous email, there is a better way<tm>

Cheers,
Jes

>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index aa76865..bc3a085 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -3159,25 +3159,12 @@ static void handle_stripe_dirtying(struct r5conf *conf,
>  				   int disks)
>  {
>  	int rmw = 0, rcw = 0, i;
> -	sector_t recovery_cp = conf->mddev->recovery_cp;
> -
> -	/* RAID6 requires 'rcw' in current implementation.
> -	 * Otherwise, check whether resync is now happening or should start.
> -	 * If yes, then the array is dirty (after unclean shutdown or
> -	 * initial creation), so parity in some stripes might be inconsistent.
> -	 * In this case, we need to always do reconstruct-write, to ensure
> -	 * that in case of drive failure or read-error correction, we
> -	 * generate correct data from the parity.
> -	 */
> -	if (conf->max_degraded == 2 ||
> -	    (recovery_cp < MaxSector && sh->sector >= recovery_cp)) {
> -		/* Calculate the real rcw later - for now make it
> +	if (conf->max_degraded == 2) {
> +		/* RAID6 requires 'rcw' in current implementation
> +		 * Calculate the real rcw later - for now fake it
>  		 * look like rcw is cheaper
>  		 */
>  		rcw = 1; rmw = 2;
> -		pr_debug("force RCW max_degraded=%u, recovery_cp=%llu sh->sector=%llu\n",
> -			 conf->max_degraded, (unsigned long long)recovery_cp,
> -			 (unsigned long long)sh->sector);
>  	} else for (i = disks; i--; ) {
>  		/* would I have to read this buffer for read_modify_write */
>  		struct r5dev *dev = &sh->dev[i];

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-18  1:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18  0:14 [PATCH] Revert "md: When RAID5 is dirty, force reconstruct-write instead of read-modify-write." Jes.Sorensen
2015-02-18  1:08 ` Jes Sorensen

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).