diff options
author | NeilBrown <neilb@suse.de> | 2010-05-07 18:20:17 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-05-18 01:28:00 -0400 |
commit | af3a2cd6b8a479345786e7fe5e199ad2f6240e56 (patch) | |
tree | 10690853d80455e69bcc0d027ad6c8b9c7951332 /drivers/md/raid10.c | |
parent | 2dc40f80945ac3e5ec05c3a6c75baf09b13cee51 (diff) |
md: Fix read balancing in RAID1 and RAID10 on drives > 2TB
read_balance uses a "unsigned long" for a sector number which
will get truncated beyond 2TB.
This will cause read-balancing to be non-optimal, and can cause
data to be read from the 'wrong' branch during a resync. This has a
very small chance of returning wrong data.
Reported-by: Jordan Russell <jr-list-2010@quo.to>
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index e0742c439484..a1f5fd2d69ce 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -495,7 +495,7 @@ static int raid10_mergeable_bvec(struct request_queue *q, | |||
495 | */ | 495 | */ |
496 | static int read_balance(conf_t *conf, r10bio_t *r10_bio) | 496 | static int read_balance(conf_t *conf, r10bio_t *r10_bio) |
497 | { | 497 | { |
498 | const unsigned long this_sector = r10_bio->sector; | 498 | const sector_t this_sector = r10_bio->sector; |
499 | int disk, slot, nslot; | 499 | int disk, slot, nslot; |
500 | const int sectors = r10_bio->sectors; | 500 | const int sectors = r10_bio->sectors; |
501 | sector_t new_distance, current_distance; | 501 | sector_t new_distance, current_distance; |