]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
md: ensure new badblocks are handled promptly.
authorNeilBrown <neilb@suse.de>
Thu, 8 Dec 2011 05:26:08 +0000 (16:26 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 8 Dec 2011 05:26:08 +0000 (16:26 +1100)
When we mark blocks as bad we need them to be acknowledged by the
metadata handler promptly.

For an in-kernel metadata handler that was already being done.  But
for an external metadata handler we need to alert it of the change by
sending a notification through the sysfs file.  This adds that
notification.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index d730e8f513a713320a76f5408d2f37370f5893b4..ee981737edfcf3ff674749116d44d89bd45be751 100644 (file)
@@ -7858,6 +7858,7 @@ int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
                                  s + rdev->data_offset, sectors, acknowledged);
        if (rv) {
                /* Make sure they get written out promptly */
+               sysfs_notify_dirent_safe(rdev->sysfs_state);
                set_bit(MD_CHANGE_CLEAN, &rdev->mddev->flags);
                md_wakeup_thread(rdev->mddev->thread);
        }