md: Using poll /proc/mdstat can monitor the events of adding a spare disks
author马建朋 <majianpeng@gmail.com>
Thu, 9 Jun 2011 01:42:48 +0000 (11:42 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 01:42:48 +0000 (11:42 +1000)
Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index 9160463b5f6860445bd4ffa68c9e066b8b711b40..734bc0996390f5c0ad0a7288aa3cd40256755e4b 100644 (file)
@@ -5274,6 +5274,8 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
                if (mddev->degraded)
                        set_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
                set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+               if (!err)
+                       md_new_event(mddev);
                md_wakeup_thread(mddev->thread);
                return err;
        }