summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2016-01-06 14:37:14 -0800
committerNeilBrown <neilb@suse.com>2016-01-14 11:49:43 +1100
commit87d4d91616e4db9b8293ba9d9e5a2f3f0d0c8aa6 (patch)
treede66672eef0323ee4f5bce959a0ba86a646362b6 /drivers/md
parenta62ab49eb502a07814f9942770893118c6281223 (diff)
downloadop-kernel-dev-87d4d91616e4db9b8293ba9d9e5a2f3f0d0c8aa6.zip
op-kernel-dev-87d4d91616e4db9b8293ba9d9e5a2f3f0d0c8aa6.tar.gz
MD: add journal with array suspended
Hot add journal disk in recovery thread context brings a lot of trouble as IO could be running. Unlike spare disk hot add, adding journal disk with array suspended makes more sense and implmentation is much easier. Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 29a4bbf..8753dee 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2455,15 +2455,20 @@ static int add_bound_rdev(struct md_rdev *rdev)
{
struct mddev *mddev = rdev->mddev;
int err = 0;
+ bool add_journal = test_bit(Journal, &rdev->flags);
- if (!mddev->pers->hot_remove_disk) {
+ if (!mddev->pers->hot_remove_disk || add_journal) {
/* If there is hot_add_disk but no hot_remove_disk
* then added disks for geometry changes,
* and should be added immediately.
*/
super_types[mddev->major_version].
validate_super(mddev, rdev);
+ if (add_journal)
+ mddev_suspend(mddev);
err = mddev->pers->hot_add_disk(mddev, rdev);
+ if (add_journal)
+ mddev_resume(mddev);
if (err) {
unbind_rdev_from_array(rdev);
export_rdev(rdev);
OpenPOWER on IntegriCloud