• Mikulas Patocka's avatar
    dm mpath: flush keventd queue in destructor · 53b351f9
    Mikulas Patocka authored
    The commit fe9cf30e 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: default avatarMikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
    Cc: stable@kernel.org
    53b351f9
dm-mpath.c 33.9 KB