aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-03-31 00:15:05 -0400
committerNeilBrown <neilb@suse.de>2009-03-31 00:15:05 -0400
commitcea9c22800773cecb1d41f4a6139f9eb6a95368b (patch)
treed070d22390b86768fefb8ba04c64d74993ed28e9 /drivers/md/md.c
parent7ec0547838976d088dfb9cb0adb073e6e8a15aa3 (diff)
md: add explicit method to signal the end of a reshape.
Currently raid5 (the only module that supports restriping) notices that the reshape has finished be sync_request being given a large value, and handles any cleanup them. This patch changes it so md_check_recovery calls into an explicit finish_reshape method as well. The clean-up from sync_request can do things that need to be done promptly, typically things local to the raid5_conf_t structure. The "finish_reshape" method is called under the mddev_lock so it can do things involving reconfiguring the device. This allows us to get rid of md_set_array_sectors_locked, which would have caused a deadlock if you tried to stop and array while a reshape was happening. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 923d1250b9a9..c50931352b23 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5073,14 +5073,6 @@ void md_set_array_sectors(mddev_t *mddev, sector_t array_sectors)
5073} 5073}
5074EXPORT_SYMBOL(md_set_array_sectors); 5074EXPORT_SYMBOL(md_set_array_sectors);
5075 5075
5076void md_set_array_sectors_lock(mddev_t *mddev, sector_t array_sectors)
5077{
5078 mddev_lock(mddev);
5079 md_set_array_sectors(mddev, array_sectors);
5080 mddev_unlock(mddev);
5081}
5082EXPORT_SYMBOL(md_set_array_sectors_lock);
5083
5084static int update_size(mddev_t *mddev, sector_t num_sectors) 5076static int update_size(mddev_t *mddev, sector_t num_sectors)
5085{ 5077{
5086 mdk_rdev_t *rdev; 5078 mdk_rdev_t *rdev;
@@ -6641,6 +6633,9 @@ void md_check_recovery(mddev_t *mddev)
6641 sysfs_notify(&mddev->kobj, NULL, 6633 sysfs_notify(&mddev->kobj, NULL,
6642 "degraded"); 6634 "degraded");
6643 } 6635 }
6636 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
6637 mddev->pers->finish_reshape)
6638 mddev->pers->finish_reshape(mddev);
6644 md_update_sb(mddev, 1); 6639 md_update_sb(mddev, 1);
6645 6640
6646 /* if array is no-longer degraded, then any saved_raid_disk 6641 /* if array is no-longer degraded, then any saved_raid_disk