Skip to contentSkip to conversation

Notify sysfs when RAID1 disk is In_sync.

PATCH New Adrian Drzewiecki 1 participant 1 message Jul 26, 2010 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Notify sysfs when RAID1 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.

---
 drivers/md/raid1.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/md/raid1.c +1 -0
index a948da8..fe241fc 100644
@@ -1136,6 +1136,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);
                }
        }