diff options
author | Neil Brown <neilb@notabene.brown> | 2008-06-28 08:31:43 +1000 |
---|---|---|
committer | Neil Brown <neilb@notabene.brown> | 2008-06-28 08:31:43 +1000 |
commit | a99ac97113d5bc25ddc4d17f404c2024ac6c57f9 (patch) | |
tree | b1848af670eb9f67961f7abc7cd5a19a07b9b37e /drivers/md/md.c | |
parent | 72a23c211e4587859d5bf61ac4962d76e593fb02 (diff) |
Make sure all changes to md/degraded are notified.
When a device fails, when a spare is activated, when
an array is reshaped, or when an array is started,
the extent to which the array is degraded can change.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index c26dcad8a3ac..60d4cad88c20 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2969,6 +2969,7 @@ action_store(mddev_t *mddev, const char *page, size_t len) err = mddev->pers->start_reshape(mddev); if (err) return err; + sysfs_notify(&mddev->kobj, NULL, "degraded"); } else { if (cmd_match(page, "check")) set_bit(MD_RECOVERY_CHECK, &mddev->recovery); @@ -3686,6 +3687,7 @@ static int do_md_run(mddev_t * mddev) md_new_event(mddev); sysfs_notify(&mddev->kobj, NULL, "array_state"); sysfs_notify(&mddev->kobj, NULL, "sync_action"); + sysfs_notify(&mddev->kobj, NULL, "degraded"); kobject_uevent(&mddev->gendisk->dev.kobj, KOBJ_CHANGE); return 0; } @@ -6049,7 +6051,9 @@ void md_check_recovery(mddev_t *mddev) if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { /* success...*/ /* activate any spares */ - mddev->pers->spare_active(mddev); + if (mddev->pers->spare_active(mddev)) + sysfs_notify(&mddev->kobj, NULL, + "degraded"); } md_update_sb(mddev, 1); |