]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
dm raid1: flush workqueue before destruction
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 13 Nov 2008 23:38:52 +0000 (23:38 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 13 Nov 2008 23:38:52 +0000 (23:38 +0000)
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
drivers/md/dm-raid1.c

index 9d7b53ed75b228e05bc865571afdd424da92f483..ec43f9fa4b2acaffed0bf45f79edc5a115f36804 100644 (file)
@@ -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);