From 0e67cdb9bd986e1b4dfa915ae8c2e7c2687f3df2 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Sat, 5 Nov 2011 03:49:49 +0800 Subject: [PATCH] LU-824 corrupted ldiskfs after md rebuild (bz24264) Pick up a patch from upstream to fix the md bug may cause a corruption issue after rebuild. Change-Id: I802ff3b3d5e86b9d9e77e57d1d98004c17e800a6 Signed-off-by: Yang Sheng Reviewed-on: http://review.whamcloud.com/1650 Reviewed-by: Jinshan Xiong Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- .../patches/raid5-rebuild-corrupt-bug.patch | 26 ++++++++++++++++++++++ lustre/kernel_patches/series/2.6-rhel5.series | 1 + 2 files changed, 27 insertions(+) create mode 100644 lustre/kernel_patches/patches/raid5-rebuild-corrupt-bug.patch diff --git a/lustre/kernel_patches/patches/raid5-rebuild-corrupt-bug.patch b/lustre/kernel_patches/patches/raid5-rebuild-corrupt-bug.patch new file mode 100644 index 0000000..c434498 --- /dev/null +++ b/lustre/kernel_patches/patches/raid5-rebuild-corrupt-bug.patch @@ -0,0 +1,26 @@ +While the stripe in-memory must be in-sync, the stripe on disk might not be +because if we computed a block rather than reading it from an in-sync disk, +the in-memory stripe can be different from the on-disk stripe. + +If this bug were still in mainline I would probably want a bigger patch which +would leave this code but also set R5_LOCKED on all blocks that have been +computed. But as it is a stablisation patch, the above is simple and more +clearly correct. + +Thanks for you patience - I look forward to your success/failure report. + +NeilBrown + +diff -up /drivers/md/raid5.c +=========================================== +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -2466,8 +2466,6 @@ + locked++; + set_bit(R5_Wantwrite, &sh->dev[i].flags); + } +- /* after a RECONSTRUCT_WRITE, the stripe MUST be in-sync */ +- set_bit(STRIPE_INSYNC, &sh->state); + + if (test_and_clear_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) { + atomic_dec(&conf->preread_active_stripes); diff --git a/lustre/kernel_patches/series/2.6-rhel5.series b/lustre/kernel_patches/series/2.6-rhel5.series index f1b1346..97402e9 100644 --- a/lustre/kernel_patches/series/2.6-rhel5.series +++ b/lustre/kernel_patches/series/2.6-rhel5.series @@ -15,6 +15,7 @@ raid5-stripe-by-stripe-handling-rhel5.patch raid5-merge-ios-rhel5.patch raid5-zerocopy-rhel5.patch raid5-maxsectors-rhel5.patch +raid5-rebuild-corrupt-bug.patch md-rebuild-policy.patch jbd-journal-chksum-2.6.18-vanilla.patch quota-large-limits-rhel5.patch -- 1.8.3.1