diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-22 18:36:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-22 18:36:17 -0500 |
commit | ad1fca2003822ff2f24c88ad68a29970c5e0d0a7 (patch) | |
tree | 710fdaa4423365414bd2ab43b135557b7469fc39 /drivers | |
parent | b3b1b70e62a603f473619dbebc3b3d23f535e6f8 (diff) | |
parent | 961902c0f8240175729274cd14198872f42072b7 (diff) |
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md:
md/bitmap: It is OK to clear bits during recovery.
md: don't give up looking for spares on first failure-to-add
md/raid5: ensure correct assessment of drives during degraded reshape.
md/linear: fix hot-add of devices to linear arrays.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/bitmap.c | 5 | ||||
-rw-r--r-- | drivers/md/linear.c | 1 | ||||
-rw-r--r-- | drivers/md/md.c | 3 | ||||
-rw-r--r-- | drivers/md/raid5.c | 14 |
4 files changed, 13 insertions, 10 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index b6907118283a..6d03774b176e 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1393,9 +1393,6 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto | |||
1393 | atomic_read(&bitmap->behind_writes), | 1393 | atomic_read(&bitmap->behind_writes), |
1394 | bitmap->mddev->bitmap_info.max_write_behind); | 1394 | bitmap->mddev->bitmap_info.max_write_behind); |
1395 | } | 1395 | } |
1396 | if (bitmap->mddev->degraded) | ||
1397 | /* Never clear bits or update events_cleared when degraded */ | ||
1398 | success = 0; | ||
1399 | 1396 | ||
1400 | while (sectors) { | 1397 | while (sectors) { |
1401 | sector_t blocks; | 1398 | sector_t blocks; |
@@ -1409,7 +1406,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto | |||
1409 | return; | 1406 | return; |
1410 | } | 1407 | } |
1411 | 1408 | ||
1412 | if (success && | 1409 | if (success && !bitmap->mddev->degraded && |
1413 | bitmap->events_cleared < bitmap->mddev->events) { | 1410 | bitmap->events_cleared < bitmap->mddev->events) { |
1414 | bitmap->events_cleared = bitmap->mddev->events; | 1411 | bitmap->events_cleared = bitmap->mddev->events; |
1415 | bitmap->need_sync = 1; | 1412 | bitmap->need_sync = 1; |
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index c3273efd08cb..627456542fb3 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -230,6 +230,7 @@ static int linear_add(struct mddev *mddev, struct md_rdev *rdev) | |||
230 | return -EINVAL; | 230 | return -EINVAL; |
231 | 231 | ||
232 | rdev->raid_disk = rdev->saved_raid_disk; | 232 | rdev->raid_disk = rdev->saved_raid_disk; |
233 | rdev->saved_raid_disk = -1; | ||
233 | 234 | ||
234 | newconf = linear_conf(mddev,mddev->raid_disks+1); | 235 | newconf = linear_conf(mddev,mddev->raid_disks+1); |
235 | 236 | ||
diff --git a/drivers/md/md.c b/drivers/md/md.c index ee981737edfc..f47f1f8ac44b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -7360,8 +7360,7 @@ static int remove_and_add_spares(struct mddev *mddev) | |||
7360 | spares++; | 7360 | spares++; |
7361 | md_new_event(mddev); | 7361 | md_new_event(mddev); |
7362 | set_bit(MD_CHANGE_DEVS, &mddev->flags); | 7362 | set_bit(MD_CHANGE_DEVS, &mddev->flags); |
7363 | } else | 7363 | } |
7364 | break; | ||
7365 | } | 7364 | } |
7366 | } | 7365 | } |
7367 | } | 7366 | } |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 31670f8d6b65..858fdbb7eb07 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3065,11 +3065,17 @@ static void analyse_stripe(struct stripe_head *sh, struct stripe_head_state *s) | |||
3065 | } | 3065 | } |
3066 | } else if (test_bit(In_sync, &rdev->flags)) | 3066 | } else if (test_bit(In_sync, &rdev->flags)) |
3067 | set_bit(R5_Insync, &dev->flags); | 3067 | set_bit(R5_Insync, &dev->flags); |
3068 | else { | 3068 | else if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset) |
3069 | /* in sync if before recovery_offset */ | 3069 | /* in sync if before recovery_offset */ |
3070 | if (sh->sector + STRIPE_SECTORS <= rdev->recovery_offset) | 3070 | set_bit(R5_Insync, &dev->flags); |
3071 | set_bit(R5_Insync, &dev->flags); | 3071 | else if (test_bit(R5_UPTODATE, &dev->flags) && |
3072 | } | 3072 | test_bit(R5_Expanded, &dev->flags)) |
3073 | /* If we've reshaped into here, we assume it is Insync. | ||
3074 | * We will shortly update recovery_offset to make | ||
3075 | * it official. | ||
3076 | */ | ||
3077 | set_bit(R5_Insync, &dev->flags); | ||
3078 | |||
3073 | if (rdev && test_bit(R5_WriteError, &dev->flags)) { | 3079 | if (rdev && test_bit(R5_WriteError, &dev->flags)) { |
3074 | clear_bit(R5_Insync, &dev->flags); | 3080 | clear_bit(R5_Insync, &dev->flags); |
3075 | if (!test_bit(Faulty, &rdev->flags)) { | 3081 | if (!test_bit(Faulty, &rdev->flags)) { |