summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-crypt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index d8126ac8296..262ed181669 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -719,16 +719,15 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
remaining -= clone->bi_size;
+ crypt_inc_pending(io);
r = crypt_convert(cc, &io->ctx);
if (atomic_dec_and_test(&io->ctx.pending)) {
/* processed, no running async crypto */
- crypt_inc_pending(io);
kcryptd_crypt_write_io_submit(io, r, 0);
if (unlikely(r < 0))
break;
- } else
- crypt_inc_pending(io);
+ }
/* out of memory -> run queues */
if (unlikely(remaining)) {