]> git.baikalelectronics.ru Git - kernel.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)
committerAlasdair G Kergon <agk@redhat.com>
Mon, 22 Jun 2009 09:12:13 +0000 (10:12 +0100)
commitaf3b29e21974f91307f86e7562378ea2b5fe0aeb
tree0a3736a570dc7ff3c6ebf0993950a36a9784b142
parent2574be28f1f439263e7ec6011cd3e0a1d8b973de
dm mpath: flush keventd queue in destructor

The commit b5a72cccfac77997b44b2a75178aac8e3d3f38cd 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
drivers/md/dm-mpath.c