From e6ffbcb6cd0ac471223df24ae77eb486c1ee68cc Mon Sep 17 00:00:00 2001 From: Adrian Drzewiecki Date: Wed, 18 Aug 2010 11:49:02 +1000 Subject: md: Notify sysfs when RAID1/5/10 disk is In_sync. When RAID1 is done syncing disks, it'll update the state of synced rdevs to In_sync. But it neglected to notify sysfs that the attribute changed. So any programs that are waiting for an rdev's state to change will not be woken. (raid5/raid10 added by neilb) Signed-off-by: Adrian Drzewiecki Signed-off-by: NeilBrown --- drivers/md/raid1.c | 1 + drivers/md/raid10.c | 1 + drivers/md/raid5.c | 1 + 3 files changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 73cc74ffc26b..0e1abf1bb38e 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1135,6 +1135,7 @@ static int raid1_spare_active(mddev_t *mddev) spin_lock_irqsave(&conf->device_lock, flags); mddev->degraded--; spin_unlock_irqrestore(&conf->device_lock, flags); + sysfs_notify_dirent(rdev->sysfs_state); } } diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index a88aeb5198c7..76d1fc9c65ba 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1130,6 +1130,7 @@ static int raid10_spare_active(mddev_t *mddev) spin_lock_irqsave(&conf->device_lock, flags); mddev->degraded--; spin_unlock_irqrestore(&conf->device_lock, flags); + sysfs_notify_dirent(tmp->rdev->sysfs_state); } } diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 866d4b5a144c..7865dd090bde 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5341,6 +5341,7 @@ static int raid5_spare_active(mddev_t *mddev) spin_lock_irqsave(&conf->device_lock, flags); mddev->degraded--; spin_unlock_irqrestore(&conf->device_lock, flags); + sysfs_notify_dirent(tmp->rdev->sysfs_state); } } print_raid5_conf(conf); -- cgit v1.2.3