diff options
author | NeilBrown <neilb@suse.de> | 2006-03-27 04:18:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:45:02 -0500 |
commit | e464eafdb4400c6d6576ba3840d8bd40340f8a96 (patch) | |
tree | 0c3f4003c883264ee08300c02007f06e4d1ebb91 /drivers/md/raid5.c | |
parent | 16484bf59634e25d1299761e5ed8bacf22bc6368 (diff) |
[PATCH] md: Support suspending of IO to regions of an md array
This allows user-space to access data safely. This is needed for raid5
reshape as user-space needs to take a backup of the first few stripes before
allowing reshape to commence.
It will also be useful in cluster-aware raid1 configurations so that all
cluster members can leave a section of the array untouched while a
resync/recovery happens.
A 'start' and 'end' of the suspended range are written to 2 sysfs attributes.
Note that only one range can be suspended at a time.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 355dafb98aac..bb16ac231a40 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -1805,6 +1805,15 @@ static int make_request(request_queue_t *q, struct bio * bi) | |||
1805 | goto retry; | 1805 | goto retry; |
1806 | } | 1806 | } |
1807 | } | 1807 | } |
1808 | /* FIXME what if we get a false positive because these | ||
1809 | * are being updated. | ||
1810 | */ | ||
1811 | if (logical_sector >= mddev->suspend_lo && | ||
1812 | logical_sector < mddev->suspend_hi) { | ||
1813 | release_stripe(sh); | ||
1814 | schedule(); | ||
1815 | goto retry; | ||
1816 | } | ||
1808 | 1817 | ||
1809 | if (test_bit(STRIPE_EXPANDING, &sh->state) || | 1818 | if (test_bit(STRIPE_EXPANDING, &sh->state) || |
1810 | !add_stripe_bio(sh, bi, dd_idx, (bi->bi_rw&RW_MASK))) { | 1819 | !add_stripe_bio(sh, bi, dd_idx, (bi->bi_rw&RW_MASK))) { |
@@ -2725,6 +2734,10 @@ static void raid5_quiesce(mddev_t *mddev, int state) | |||
2725 | raid5_conf_t *conf = mddev_to_conf(mddev); | 2734 | raid5_conf_t *conf = mddev_to_conf(mddev); |
2726 | 2735 | ||
2727 | switch(state) { | 2736 | switch(state) { |
2737 | case 2: /* resume for a suspend */ | ||
2738 | wake_up(&conf->wait_for_overlap); | ||
2739 | break; | ||
2740 | |||
2728 | case 1: /* stop all writes */ | 2741 | case 1: /* stop all writes */ |
2729 | spin_lock_irq(&conf->device_lock); | 2742 | spin_lock_irq(&conf->device_lock); |
2730 | conf->quiesce = 1; | 2743 | conf->quiesce = 1; |
@@ -2738,6 +2751,7 @@ static void raid5_quiesce(mddev_t *mddev, int state) | |||
2738 | spin_lock_irq(&conf->device_lock); | 2751 | spin_lock_irq(&conf->device_lock); |
2739 | conf->quiesce = 0; | 2752 | conf->quiesce = 0; |
2740 | wake_up(&conf->wait_for_stripe); | 2753 | wake_up(&conf->wait_for_stripe); |
2754 | wake_up(&conf->wait_for_overlap); | ||
2741 | spin_unlock_irq(&conf->device_lock); | 2755 | spin_unlock_irq(&conf->device_lock); |
2742 | break; | 2756 | break; |
2743 | } | 2757 | } |