Skip to content

Commit 8bd2f0a

Browse files
committed
md: ensure new badblocks are handled promptly.
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 <[email protected]>
1 parent 52c6415 commit 8bd2f0a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/md/md.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7858,6 +7858,7 @@ int rdev_set_badblocks(struct md_rdev *rdev, sector_t s, int sectors,
78587858
s + rdev->data_offset, sectors, acknowledged);
78597859
if (rv) {
78607860
/* Make sure they get written out promptly */
7861+
sysfs_notify_dirent_safe(rdev->sysfs_state);
78617862
set_bit(MD_CHANGE_CLEAN, &rdev->mddev->flags);
78627863
md_wakeup_thread(rdev->mddev->thread);
78637864
}

0 commit comments

Comments
 (0)