]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm mpath: flush keventd queue in destructor
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 22 Jun 2009 09:12:13 +0000 (10:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Jul 2009 23:50:43 +0000 (16:50 -0700)
commit5c84f975daf48dbbe409486f94fae55b43b1c57a
tree9082c8743605d514a80a483488fd514b8fc8689f
parent7dce9502a4396efca6d4c962f083440900ea9951
dm mpath: flush keventd queue in destructor

commit 53b351f972a882ea8b6cdb19602535f1057c884a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-mpath.c