diff options
author | NeilBrown <neilb@suse.de> | 2012-01-08 08:46:41 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-01-10 16:35:14 -0500 |
commit | f2a371c5e74dd5685ab47effa4ac7b23b1fdaae5 (patch) | |
tree | e1960be50588ef0a4461fa54609df7ebea95eac5 /drivers/md | |
parent | 19d671695e1931ebfd75b2b888778201aefe35ca (diff) |
md: notify the 'degraded' sysfs attribute on failure.
We currently only 'notify' changes to the 'degraded' attribute
when it decreases, not when it increases.
Notifying on failure is a little awkward as it happen in
interrupt context.
So instead, notify when we remove the failed device from the array,
which is very soon afterwards.
Reported-and-tested-by: Mikhail Balabin <mbalabin@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 1c1c562f63dc..33aa06f12b87 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -7383,6 +7383,7 @@ static int remove_and_add_spares(struct mddev *mddev) | |||
7383 | { | 7383 | { |
7384 | struct md_rdev *rdev; | 7384 | struct md_rdev *rdev; |
7385 | int spares = 0; | 7385 | int spares = 0; |
7386 | int removed = 0; | ||
7386 | 7387 | ||
7387 | mddev->curr_resync_completed = 0; | 7388 | mddev->curr_resync_completed = 0; |
7388 | 7389 | ||
@@ -7396,8 +7397,13 @@ static int remove_and_add_spares(struct mddev *mddev) | |||
7396 | mddev, rdev) == 0) { | 7397 | mddev, rdev) == 0) { |
7397 | sysfs_unlink_rdev(mddev, rdev); | 7398 | sysfs_unlink_rdev(mddev, rdev); |
7398 | rdev->raid_disk = -1; | 7399 | rdev->raid_disk = -1; |
7400 | removed++; | ||
7399 | } | 7401 | } |
7400 | } | 7402 | } |
7403 | if (removed) | ||
7404 | sysfs_notify(&mddev->kobj, NULL, | ||
7405 | "degraded"); | ||
7406 | |||
7401 | 7407 | ||
7402 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 7408 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
7403 | if (rdev->raid_disk >= 0 && | 7409 | if (rdev->raid_disk >= 0 && |