]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] dm io: fix panic on large request
authorMilan Broz <mbroz@redhat.com>
Sat, 21 Jul 2007 11:37:27 +0000 (04:37 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Aug 2007 15:24:08 +0000 (17:24 +0200)
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/md/dm-crypt.c

index b9ff4e368aad5478fd0e066f1b600a3622183b6e..6b50991623efba106b9004ff5f521f8b17927a93 100644 (file)
@@ -917,6 +917,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);