aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorDavid Brown <davidb@codeaurora.org>2011-03-17 01:13:16 -0400
committerDavid Brown <davidb@codeaurora.org>2011-03-17 01:13:16 -0400
commit92c260f755c42337c550d8ac1f8ccd1b32bffb20 (patch)
tree6d04fefc1adeecabfb2b00c201e0db78fa2b5529 /drivers/md/raid5.c
parent8e76a80960bf06c245160a484d5a363ca6b520bb (diff)
parent05e34754518b6a90d5c392790c032575fab12d66 (diff)
Merge remote branch 'rmk/for-linus' into for-linus
* rmk/for-linus: (1557 commits) ARM: 6806/1: irq: introduce entry and exit functions for chained handlers ARM: 6781/1: Thumb-2: Work around buggy Thumb-2 short branch relocations in gas ARM: 6747/1: P2V: Thumb2 support ARM: 6798/1: aout-core: zero thread debug registers in a.out core dump ARM: 6796/1: Footbridge: Fix I/O mappings for NOMMU mode ARM: 6784/1: errata: no automatic Store Buffer drain on Cortex-A9 ARM: 6772/1: errata: possible fault MMU translations following an ASID switch ARM: 6776/1: mach-ux500: activate fix for errata 753970 ARM: 6794/1: SPEAr: Append UL to device address macros. ARM: 6793/1: SPEAr: Remove unused *_SIZE macros from spear*.h files ARM: 6792/1: SPEAr: Replace SIZE macro's with SZ_4K macros ARM: 6791/1: SPEAr3xx: Declare device structures after shirq code ARM: 6790/1: SPEAr: Clock Framework: Rename usbd clock and align apb_clk entry ARM: 6789/1: SPEAr3xx: Rename sdio to sdhci ARM: 6788/1: SPEAr: Include mach/hardware.h instead of mach/spear.h ARM: 6787/1: SPEAr: Reorder #includes in .h & .c files. ARM: 6681/1: SPEAr: add debugfs support to clk API ARM: 6703/1: SPEAr: update clk API support ARM: 6679/1: SPEAr: make clk API functions more generic ARM: 6737/1: SPEAr: formalized timer support ... Conflicts: arch/arm/mach-msm/board-msm7x27.c arch/arm/mach-msm/board-msm7x30.c arch/arm/mach-msm/board-qsd8x50.c arch/arm/mach-msm/board-sapphire.c arch/arm/mach-msm/include/mach/memory.h
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 5044babfcda0..78536fdbd87f 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5204,7 +5204,6 @@ static int run(mddev_t *mddev)
5204 5204
5205 mddev->queue->backing_dev_info.congested_data = mddev; 5205 mddev->queue->backing_dev_info.congested_data = mddev;
5206 mddev->queue->backing_dev_info.congested_fn = raid5_congested; 5206 mddev->queue->backing_dev_info.congested_fn = raid5_congested;
5207 mddev->queue->queue_lock = &conf->device_lock;
5208 mddev->queue->unplug_fn = raid5_unplug_queue; 5207 mddev->queue->unplug_fn = raid5_unplug_queue;
5209 5208
5210 chunk_size = mddev->chunk_sectors << 9; 5209 chunk_size = mddev->chunk_sectors << 9;
@@ -5517,7 +5516,6 @@ static int raid5_start_reshape(mddev_t *mddev)
5517 raid5_conf_t *conf = mddev->private; 5516 raid5_conf_t *conf = mddev->private;
5518 mdk_rdev_t *rdev; 5517 mdk_rdev_t *rdev;
5519 int spares = 0; 5518 int spares = 0;
5520 int added_devices = 0;
5521 unsigned long flags; 5519 unsigned long flags;
5522 5520
5523 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) 5521 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery))
@@ -5527,8 +5525,8 @@ static int raid5_start_reshape(mddev_t *mddev)
5527 return -ENOSPC; 5525 return -ENOSPC;
5528 5526
5529 list_for_each_entry(rdev, &mddev->disks, same_set) 5527 list_for_each_entry(rdev, &mddev->disks, same_set)
5530 if ((rdev->raid_disk < 0 || rdev->raid_disk >= conf->raid_disks) 5528 if (!test_bit(In_sync, &rdev->flags)
5531 && !test_bit(Faulty, &rdev->flags)) 5529 && !test_bit(Faulty, &rdev->flags))
5532 spares++; 5530 spares++;
5533 5531
5534 if (spares - mddev->degraded < mddev->delta_disks - conf->max_degraded) 5532 if (spares - mddev->degraded < mddev->delta_disks - conf->max_degraded)
@@ -5571,34 +5569,35 @@ static int raid5_start_reshape(mddev_t *mddev)
5571 * to correctly record the "partially reconstructed" state of 5569 * to correctly record the "partially reconstructed" state of
5572 * such devices during the reshape and confusion could result. 5570 * such devices during the reshape and confusion could result.
5573 */ 5571 */
5574 if (mddev->delta_disks >= 0) 5572 if (mddev->delta_disks >= 0) {
5575 list_for_each_entry(rdev, &mddev->disks, same_set) 5573 int added_devices = 0;
5576 if (rdev->raid_disk < 0 && 5574 list_for_each_entry(rdev, &mddev->disks, same_set)
5577 !test_bit(Faulty, &rdev->flags)) { 5575 if (rdev->raid_disk < 0 &&
5578 if (raid5_add_disk(mddev, rdev) == 0) { 5576 !test_bit(Faulty, &rdev->flags)) {
5579 char nm[20]; 5577 if (raid5_add_disk(mddev, rdev) == 0) {
5580 if (rdev->raid_disk >= conf->previous_raid_disks) { 5578 char nm[20];
5581 set_bit(In_sync, &rdev->flags); 5579 if (rdev->raid_disk
5582 added_devices++; 5580 >= conf->previous_raid_disks) {
5583 } else 5581 set_bit(In_sync, &rdev->flags);
5584 rdev->recovery_offset = 0; 5582 added_devices++;
5585 sprintf(nm, "rd%d", rdev->raid_disk); 5583 } else
5586 if (sysfs_create_link(&mddev->kobj, 5584 rdev->recovery_offset = 0;
5587 &rdev->kobj, nm)) 5585 sprintf(nm, "rd%d", rdev->raid_disk);
5588 /* Failure here is OK */; 5586 if (sysfs_create_link(&mddev->kobj,
5589 } else 5587 &rdev->kobj, nm))
5590 break; 5588 /* Failure here is OK */;
5591 } else if (rdev->raid_disk >= conf->previous_raid_disks 5589 }
5592 && !test_bit(Faulty, &rdev->flags)) { 5590 } else if (rdev->raid_disk >= conf->previous_raid_disks
5593 /* This is a spare that was manually added */ 5591 && !test_bit(Faulty, &rdev->flags)) {
5594 set_bit(In_sync, &rdev->flags); 5592 /* This is a spare that was manually added */
5595 added_devices++; 5593 set_bit(In_sync, &rdev->flags);
5596 } 5594 added_devices++;
5595 }
5597 5596
5598 /* When a reshape changes the number of devices, ->degraded 5597 /* When a reshape changes the number of devices,
5599 * is measured against the larger of the pre and post number of 5598 * ->degraded is measured against the larger of the
5600 * devices.*/ 5599 * pre and post number of devices.
5601 if (mddev->delta_disks > 0) { 5600 */
5602 spin_lock_irqsave(&conf->device_lock, flags); 5601 spin_lock_irqsave(&conf->device_lock, flags);
5603 mddev->degraded += (conf->raid_disks - conf->previous_raid_disks) 5602 mddev->degraded += (conf->raid_disks - conf->previous_raid_disks)
5604 - added_devices; 5603 - added_devices;