diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-06 07:41:10 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-06 07:41:10 -0800 |
commit | b2a740aab8f3bc2fd9f01528e39607bd9a1f0da6 (patch) | |
tree | bf864e71484732b0fa1f0bfa279242ae4d89bc00 /drivers/md/linear.c | |
parent | 9be260a646bf76fa418ee519afa10196b3164681 (diff) | |
parent | de01dfadf25bf83cfe3d85c163005c4320532658 (diff) | |
download | kernel-crypto-b2a740aab8f3bc2fd9f01528e39607bd9a1f0da6.tar.gz kernel-crypto-b2a740aab8f3bc2fd9f01528e39607bd9a1f0da6.tar.xz kernel-crypto-b2a740aab8f3bc2fd9f01528e39607bd9a1f0da6.zip |
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md:
md: Ensure an md array never has too many devices.
md: Fix a bug in linear.c causing which_dev() to return the wrong device.
md: Allow read error in a single drive raid1 to be passed up.
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r-- | drivers/md/linear.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 1e3aea9eecf..09658b21847 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c @@ -25,13 +25,13 @@ static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector) { dev_info_t *hash; linear_conf_t *conf = mddev_to_conf(mddev); + sector_t idx = sector >> conf->sector_shift; /* * sector_div(a,b) returns the remainer and sets a to a/b */ - sector >>= conf->sector_shift; - (void)sector_div(sector, conf->spacing); - hash = conf->hash_table[sector]; + (void)sector_div(idx, conf->spacing); + hash = conf->hash_table[idx]; while (sector >= hash->num_sectors + hash->start_sector) hash++; |