The patch titled md: fix newly introduced read-corruption with raid6 has been added to the -mm tree. Its filename is md-fix-newly-introduced-read-corruption-with-raid6.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: md: fix newly introduced read-corruption with raid6 From: NeilBrown <neilb@xxxxxxx> chunk_aligned_read and retry_aligned_read assume that data_disks == raid_disks - 1 which is not true for raid6. So when an aligned read request bypasses the cache, we can get the wrong data. Also change the calculate of raid_disks in compute_blocknr to make it more obviously correct. Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/md/raid5.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN drivers/md/raid5.c~md-fix-newly-introduced-read-corruption-with-raid6 drivers/md/raid5.c --- a/drivers/md/raid5.c~md-fix-newly-introduced-read-corruption-with-raid6 +++ a/drivers/md/raid5.c @@ -823,7 +823,8 @@ static sector_t raid5_compute_sector(sec static sector_t compute_blocknr(struct stripe_head *sh, int i) { raid5_conf_t *conf = sh->raid_conf; - int raid_disks = sh->disks, data_disks = raid_disks - 1; + int raid_disks = sh->disks; + int data_disks = raid_disks - conf->max_degraded; sector_t new_sector = sh->sector, check; int sectors_per_chunk = conf->chunk_size >> 9; sector_t stripe; @@ -859,7 +860,6 @@ static sector_t compute_blocknr(struct s } break; case 6: - data_disks = raid_disks - 2; if (i == raid6_next_disk(sh->pd_idx, raid_disks)) return 0; /* It is the Q disk */ switch (conf->algorithm) { @@ -2725,7 +2725,7 @@ static int chunk_aligned_read(request_qu mddev_t *mddev = q->queuedata; raid5_conf_t *conf = mddev_to_conf(mddev); const unsigned int raid_disks = conf->raid_disks; - const unsigned int data_disks = raid_disks - 1; + const unsigned int data_disks = raid_disks - conf->max_degraded; unsigned int dd_idx, pd_idx; struct bio* align_bi; mdk_rdev_t *rdev; @@ -3145,7 +3145,7 @@ static int retry_aligned_read(raid5_con logical_sector = raid_bio->bi_sector & ~((sector_t)STRIPE_SECTORS-1); sector = raid5_compute_sector( logical_sector, conf->raid_disks, - conf->raid_disks-1, + conf->raid_disks - conf->max_degraded, &dd_idx, &pd_idx, conf); _ Patches currently in -mm which might be from neilb@xxxxxxx are origin.patch auth_gss-unregister-gss_domain-when-unloading-module-fix.patch fix-sunrpc-wakeup-execute-race-condition.patch lockdep-annotate-nfs-nfsd-in-kernel-sockets.patch lockdep-annotate-nfs-nfsd-in-kernel-sockets-tidy.patch remove-lock_key-approach-to-managing-nested-bd_mutex-locks.patch simplify-some-aspects-of-bd_mutex-nesting.patch use-mutex_lock_nested-for-bd_mutex-to-avoid-lockdep-warning.patch avoid-lockdep-warning-in-md.patch bdev-fix-bd_part_count-leak.patch lockdep-annotate-nfsd4-recover-code.patch md-tidy-up-device-change-notification-when-an-md-array-is-stopped.patch md-define-raid5_mergeable_bvec.patch md-handle-bypassing-the-read-cache-assuming-nothing-fails.patch md-allow-reads-that-have-bypassed-the-cache-to-be-retried-on-failure.patch md-allow-reads-that-have-bypassed-the-cache-to-be-retried-on-failure-fix.patch md-enable-bypassing-cache-for-reads.patch md-fix-innocuous-bug-in-raid6-stripe_to_pdidx.patch md-fix-newly-introduced-read-corruption-with-raid6.patch md-misc-fixes-for-aligned-read-handling.patch md-fix-a-couple-more-bugs-in-raid5-6-aligned-reads.patch md-conditionalize-some-code.patch md-change-lifetime-rules-for-md-devices.patch md-dm-reduce-stack-usage-with-stacked-block-devices.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html