Skip to content

Commit 1e37bb8

Browse files
committed
dm crypt: remove inc_pending from write_io_submit
Make the caller reponsible for incrementing the pending count before calling kcryptd_crypt_write_io_submit() in the non-async case to bring it into line with the async case. Signed-off-by: Alasdair G Kergon <[email protected]>
1 parent fc5a5e9 commit 1e37bb8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/md/dm-crypt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,8 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io,
685685

686686
if (async)
687687
kcryptd_queue_io(io);
688-
else {
689-
crypt_inc_pending(io);
688+
else
690689
generic_make_request(clone);
691-
}
692690
}
693691

694692
static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
@@ -724,9 +722,12 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
724722

725723
if (atomic_dec_and_test(&io->ctx.pending)) {
726724
/* processed, no running async crypto */
725+
crypt_inc_pending(io);
727726
kcryptd_crypt_write_io_submit(io, r, 0);
728-
if (unlikely(r < 0))
727+
if (unlikely(r < 0)) {
728+
crypt_dec_pending(io);
729729
break;
730+
}
730731
} else
731732
crypt_inc_pending(io);
732733

0 commit comments

Comments
 (0)