md: Notify sysfs when RAID1/5/10 disk is In_sync.
authorAdrian Drzewiecki <adriand@vmware.com>
Wed, 18 Aug 2010 01:49:02 +0000 (11:49 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 18 Aug 2010 01:49:02 +0000 (11:49 +1000)
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 <adriand@vmware.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c

index 73cc74ffc26bd5eefb7166aa37130e4c47daa56a..0e1abf1bb38e755a1ea24359f87cc46b820f8b45 100644 (file)
@@ -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);
                }
        }
 
index a88aeb5198c76a6c3a5ed58693d71f751ae975a7..76d1fc9c65ba4832ec806aff98cbf35b324b33ff 100644 (file)
@@ -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);
                }
        }
 
index 866d4b5a144c465daf21e439b9b0e6ef36571d6a..7865dd090bde09547b8159d073c2a072d92e36de 100644 (file)
@@ -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);