Commit 6c031f41db15b6cb0cd33545cec28ca706cd3c7e

Authored by Milan Broz
Committed by Alasdair G Kergon
1 parent 1e37bb8e55

dm crypt: move dec_pending on error into write_io_submit

Make kcryptd_crypt_write_io_submit() responsible for decrementing
the pending count after an error.

Also fixes a bug in the async path that forgot to decrement it.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

drivers/md/dm-crypt.c
... ... @@ -674,6 +674,7 @@
674 674 crypt_free_buffer_pages(cc, clone);
675 675 bio_put(clone);
676 676 io->error = -EIO;
  677 + crypt_dec_pending(io);
677 678 return;
678 679 }
679 680  
680 681  
... ... @@ -724,10 +725,8 @@
724 725 /* processed, no running async crypto */
725 726 crypt_inc_pending(io);
726 727 kcryptd_crypt_write_io_submit(io, r, 0);
727   - if (unlikely(r < 0)) {
728   - crypt_dec_pending(io);
  728 + if (unlikely(r < 0))
729 729 break;
730   - }
731 730 } else
732 731 crypt_inc_pending(io);
733 732