提交 6c031f41 编写于 作者: M Milan Broz 提交者: Alasdair G Kergon

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: NMilan Broz <mbroz@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 1e37bb8e
......@@ -674,6 +674,7 @@ static void kcryptd_crypt_write_io_submit(struct dm_crypt_io *io,
crypt_free_buffer_pages(cc, clone);
bio_put(clone);
io->error = -EIO;
crypt_dec_pending(io);
return;
}
......@@ -724,10 +725,8 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io)
/* processed, no running async crypto */
crypt_inc_pending(io);
kcryptd_crypt_write_io_submit(io, r, 0);
if (unlikely(r < 0)) {
crypt_dec_pending(io);
if (unlikely(r < 0))
break;
}
} else
crypt_inc_pending(io);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册