aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2007-07-21 07:37:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-21 20:49:14 -0400
commit80b16c192e469541263d6bfd9177662ceb632ecc (patch)
treec6e8a0abc281eac6e8139b38c4152dc366693f13 /drivers/md
parentd3fec424b23c47686efcf3f2004c3f1c1cee4d9c (diff)
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(...); <remove device request - remove mempool> 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 <mbroz@redhat.com> Cc: Chuck Ebbert <cebbert@redhat.com> Cc: Patrick McHardy <kaber@trash.net> Acked-by: Alasdair G Kergon <agk@redhat.com> Cc: Christophe Saout <christophe@saout.de> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-crypt.c2
1 files changed, 2 insertions, 0 deletions
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)
920{ 920{
921 struct crypt_config *cc = (struct crypt_config *) ti->private; 921 struct crypt_config *cc = (struct crypt_config *) ti->private;
922 922
923 flush_workqueue(_kcryptd_workqueue);
924
923 bioset_free(cc->bs); 925 bioset_free(cc->bs);
924 mempool_destroy(cc->page_pool); 926 mempool_destroy(cc->page_pool);
925 mempool_destroy(cc->io_pool); 927 mempool_destroy(cc->io_pool);