Skip to content

Commit

Permalink
md: Notify sysfs when RAID1/5/10 disk is In_sync.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Drzewiecki authored and NeilBrown committed Aug 18, 2010
1 parent 3a3a5dd commit e6ffbcb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
1 change: 1 addition & 0 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
1 change: 1 addition & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e6ffbcb

Please sign in to comment.