diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index d31aa6f33a6a..52f9865096c6 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5435,8 +5435,11 @@ void md_write_start(mddev_t *mddev, struct bio *bi) | |||
5435 | md_wakeup_thread(mddev->thread); | 5435 | md_wakeup_thread(mddev->thread); |
5436 | } | 5436 | } |
5437 | spin_unlock_irq(&mddev->write_lock); | 5437 | spin_unlock_irq(&mddev->write_lock); |
5438 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | ||
5438 | } | 5439 | } |
5439 | wait_event(mddev->sb_wait, mddev->flags==0); | 5440 | wait_event(mddev->sb_wait, |
5441 | !test_bit(MD_CHANGE_CLEAN, &mddev->flags) && | ||
5442 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); | ||
5440 | } | 5443 | } |
5441 | 5444 | ||
5442 | void md_write_end(mddev_t *mddev) | 5445 | void md_write_end(mddev_t *mddev) |
@@ -5471,6 +5474,12 @@ void md_allow_write(mddev_t *mddev) | |||
5471 | mddev->safemode = 1; | 5474 | mddev->safemode = 1; |
5472 | spin_unlock_irq(&mddev->write_lock); | 5475 | spin_unlock_irq(&mddev->write_lock); |
5473 | md_update_sb(mddev, 0); | 5476 | md_update_sb(mddev, 0); |
5477 | |||
5478 | sysfs_notify(&mddev->kobj, NULL, "array_state"); | ||
5479 | /* wait for the dirty state to be recorded in the metadata */ | ||
5480 | wait_event(mddev->sb_wait, | ||
5481 | !test_bit(MD_CHANGE_CLEAN, &mddev->flags) && | ||
5482 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); | ||
5474 | } else | 5483 | } else |
5475 | spin_unlock_irq(&mddev->write_lock); | 5484 | spin_unlock_irq(&mddev->write_lock); |
5476 | } | 5485 | } |