Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f94e87cdeaaac9f0f9a28a5dd2a5070b87cd3e8
Commit:     0f94e87cdeaaac9f0f9a28a5dd2a5070b87cd3e8
Parent:     5b7741b3325d0d94c88b2ad46657a536890aaa2f
Author:     Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 8 15:32:53 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jan 8 16:10:35 2008 -0800

    md: fix data corruption when a degraded raid5 array is reshaped
    
    We currently do not wait for the block from the missing device to be
    computed from parity before copying data to the new stripe layout.
    
    The change in the raid6 code is not techincally needed as we don't delay
    data block recovery in the same way for raid6 yet.  But making the change
    now is safer long-term.
    
    This bug exists in 2.6.23 and 2.6.24-rc
    
    Cc: <[EMAIL PROTECTED]>
    Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
    Acked-by: Neil Brown <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/md/raid5.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a5aad8c..e8c8157 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2865,7 +2865,8 @@ static void handle_stripe5(struct stripe_head *sh)
                md_done_sync(conf->mddev, STRIPE_SECTORS, 1);
        }
 
-       if (s.expanding && s.locked == 0)
+       if (s.expanding && s.locked == 0 &&
+           !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending))
                handle_stripe_expansion(conf, sh, NULL);
 
        if (sh->ops.count)
@@ -3067,7 +3068,8 @@ static void handle_stripe6(struct stripe_head *sh, struct 
page *tmp_page)
                md_done_sync(conf->mddev, STRIPE_SECTORS, 1);
        }
 
-       if (s.expanding && s.locked == 0)
+       if (s.expanding && s.locked == 0 &&
+           !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending))
                handle_stripe_expansion(conf, sh, &r6s);
 
        spin_unlock(&sh->lock);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to