Skip to content

Commit

Permalink
dm raid1: flush workqueue before destruction
Browse files Browse the repository at this point in the history
We queue work on keventd queue --- so this queue must be flushed in the
destructor. Otherwise, keventd could access mirror_set after it was freed.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: stable@kernel.org
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Nov 13, 2008
1 parent 4ffaf86 commit 18776c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/dm-raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ static void mirror_dtr(struct dm_target *ti)

del_timer_sync(&ms->timer);
flush_workqueue(ms->kmirrord_wq);
flush_scheduled_work();
dm_kcopyd_client_destroy(ms->kcopyd_client);
destroy_workqueue(ms->kmirrord_wq);
free_context(ms, ti, ms->nr_mirrors);
Expand Down

0 comments on commit 18776c7

Please sign in to comment.