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

dm crypt: fix write endio

Fix BIO_UPTODATE test for write io.

Cc: stable@kernel.org
Cc: dm-crypt@saout.de
Signed-off-by: NMilan Broz <mbroz@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 d1622e89
......@@ -511,6 +511,9 @@ static void crypt_endio(struct bio *clone, int error)
struct crypt_config *cc = io->target->private;
unsigned read_io = bio_data_dir(clone) == READ;
if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error))
error = -EIO;
/*
* free the processed pages
*/
......@@ -519,10 +522,8 @@ static void crypt_endio(struct bio *clone, int error)
goto out;
}
if (unlikely(!bio_flagged(clone, BIO_UPTODATE))) {
error = -EIO;
if (unlikely(error))
goto out;
}
bio_put(clone);
kcryptd_queue_crypt(io);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册