dm crypt: fix write endio
Alasdair G Kergon
maintainerPATCH 3/6 dm crypt: fix write endio
From: Milan Broz <[email protected]>
Fix BIO_UPTODATE test for write io.
Signed-off-by Milan Broz <[email protected]>
Signed-off-by Alasdair G Kergon <[email protected]>
--- drivers/md/dm-crypt.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/md/dm-crypt.c +4 -3
@@ -511,6 +511,9 @@ static void crypt_endio(struct bio *clonstruct 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 *clon goto out; } -if (unlikely (!bio_flagged (clone,BIO_UPTODATE ))) { - error = -EIO ; +if (unlikely (error)) goto out; - }bio_put (clone);kcryptd_queue_crypt (io);