From 80b16c192e469541263d6bfd9177662ceb632ecc Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sat, 21 Jul 2007 04:37:27 -0700 Subject: [PATCH] dm io: fix panic on large request Flush workqueue before releasing bioset and mopools in dm-crypt. There can be finished but not yet released request. Call chain causing oops: run workqueue dec_pending bio_endio(...); mempool_free(io, cc->io_pool); This usually happens when cryptsetup create temporary luks mapping in the beggining of crypt device activation. When dm-core calls destructor crypt_dtr, no new request are possible. Signed-off-by: Milan Broz Cc: Chuck Ebbert Cc: Patrick McHardy Acked-by: Alasdair G Kergon Cc: Christophe Saout Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/dm-crypt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index ba952a032598..bdc52d6922b7 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -920,6 +920,8 @@ static void crypt_dtr(struct dm_target *ti) { struct crypt_config *cc = (struct crypt_config *) ti->private; + flush_workqueue(_kcryptd_workqueue); + bioset_free(cc->bs); mempool_destroy(cc->page_pool); mempool_destroy(cc->io_pool); -- GitLab