diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-27 18:44:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-27 18:44:31 -0400 |
commit | d1d4bb9cf2cfce0eb681d5761d8e620c2d27f051 (patch) | |
tree | 13728dda66a764a9746c1729c67c983141572cb2 /drivers | |
parent | 5030fcbf0bdcefe8ac2da15bc5be8060b5cb7903 (diff) | |
parent | 80b4812407c6b1f66a4f2430e69747a13f010839 (diff) |
Merge tag 'md-3.6-fixes' of git://neil.brown.name/md
Pull two md bugfixes from NeilBrown:
"One (missing spinlock init) was only introduced recently. The other
has been present as long as raid10 has been supported, so is tagged
for -stable."
* tag 'md-3.6-fixes' of git://neil.brown.name/md:
md/raid10: fix "enough" function for detecting if array is failed.
md/raid5: add missing spin_lock_init.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid10.c | 8 | ||||
-rw-r--r-- | drivers/md/raid5.c | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 1c2eb38f3c51..0138a727c1f3 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1512,14 +1512,16 @@ static int _enough(struct r10conf *conf, struct geom *geo, int ignore) | |||
1512 | do { | 1512 | do { |
1513 | int n = conf->copies; | 1513 | int n = conf->copies; |
1514 | int cnt = 0; | 1514 | int cnt = 0; |
1515 | int this = first; | ||
1515 | while (n--) { | 1516 | while (n--) { |
1516 | if (conf->mirrors[first].rdev && | 1517 | if (conf->mirrors[this].rdev && |
1517 | first != ignore) | 1518 | this != ignore) |
1518 | cnt++; | 1519 | cnt++; |
1519 | first = (first+1) % geo->raid_disks; | 1520 | this = (this+1) % geo->raid_disks; |
1520 | } | 1521 | } |
1521 | if (cnt == 0) | 1522 | if (cnt == 0) |
1522 | return 0; | 1523 | return 0; |
1524 | first = (first + geo->near_copies) % geo->raid_disks; | ||
1523 | } while (first != 0); | 1525 | } while (first != 0); |
1524 | return 1; | 1526 | return 1; |
1525 | } | 1527 | } |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 7031b865b3a0..0689173fd9f5 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -1591,6 +1591,7 @@ static int resize_stripes(struct r5conf *conf, int newsize) | |||
1591 | #ifdef CONFIG_MULTICORE_RAID456 | 1591 | #ifdef CONFIG_MULTICORE_RAID456 |
1592 | init_waitqueue_head(&nsh->ops.wait_for_ops); | 1592 | init_waitqueue_head(&nsh->ops.wait_for_ops); |
1593 | #endif | 1593 | #endif |
1594 | spin_lock_init(&nsh->stripe_lock); | ||
1594 | 1595 | ||
1595 | list_add(&nsh->lru, &newstripes); | 1596 | list_add(&nsh->lru, &newstripes); |
1596 | } | 1597 | } |