aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-06-22 05:12:13 -0400
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 05:12:13 -0400
commit53b351f972a882ea8b6cdb19602535f1057c884a (patch)
tree0a3736a570dc7ff3c6ebf0993950a36a9784b142 /drivers/md/dm-mpath.c
parenta72986c562eeec3f7b992198c168f0f41606fe53 (diff)
dm mpath: flush keventd queue in destructor
The commit fe9cf30eb8186ef267d1868dc9f12f2d0f40835a moves dm table event submission from kmultipath queue to kernel kevent queue to avoid a deadlock. There is a possibility of race condition because kevent queue is not flushed in the multipath destructor. The scenario is: - some event happens and is queued to keventd - keventd thread is delayed due to scheuling latency or some other work - multipath device is destroyed - keventd now attempts to process work_struct that is residing in already released memory. The patch flushes the keventd queue in multipath constructor. I've already fixed similar bug in dm-raid1. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Cc: stable@kernel.org
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r--drivers/md/dm-mpath.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 838f01b1dd30..92bdcbb7c935 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -848,6 +848,7 @@ static void multipath_dtr(struct dm_target *ti)
848 848
849 flush_workqueue(kmpath_handlerd); 849 flush_workqueue(kmpath_handlerd);
850 flush_workqueue(kmultipathd); 850 flush_workqueue(kmultipathd);
851 flush_scheduled_work();
851 free_multipath(m); 852 free_multipath(m);
852} 853}
853 854