Commit 768a418d authored by NeilBrown's avatar NeilBrown

md: add support for raising dm events.

dm uses scheduled work to raise events to user-space.
So allow md device to have work_structs and schedule them on an error.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 390ee602
...@@ -6068,6 +6068,8 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev) ...@@ -6068,6 +6068,8 @@ void md_error(mddev_t *mddev, mdk_rdev_t *rdev)
set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery);
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
md_wakeup_thread(mddev->thread); md_wakeup_thread(mddev->thread);
if (mddev->event_work.func)
schedule_work(&mddev->event_work);
md_new_event_inintr(mddev); md_new_event_inintr(mddev);
} }
......
...@@ -318,6 +318,7 @@ struct mddev_s ...@@ -318,6 +318,7 @@ struct mddev_s
struct bio *barrier; struct bio *barrier;
atomic_t flush_pending; atomic_t flush_pending;
struct work_struct barrier_work; struct work_struct barrier_work;
struct work_struct event_work; /* used by dm to report failure event */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment