Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adfe4770 authored by Milan Broz's avatar Milan Broz Committed by Alasdair G Kergon
Browse files

dm crypt: fix write endio



Fix BIO_UPTODATE test for write io.

Cc: stable@kernel.org
Cc: dm-crypt@saout.de
Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent d1622e89
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -511,6 +511,9 @@ static void crypt_endio(struct bio *clone, int error)
	struct crypt_config *cc = io->target->private;
	struct crypt_config *cc = io->target->private;
	unsigned read_io = bio_data_dir(clone) == READ;
	unsigned read_io = bio_data_dir(clone) == READ;


	if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error))
		error = -EIO;

	/*
	/*
	 * free the processed pages
	 * free the processed pages
	 */
	 */
@@ -519,10 +522,8 @@ static void crypt_endio(struct bio *clone, int error)
		goto out;
		goto out;
	}
	}


	if (unlikely(!bio_flagged(clone, BIO_UPTODATE))) {
	if (unlikely(error))
		error = -EIO;
		goto out;
		goto out;
	}


	bio_put(clone);
	bio_put(clone);
	kcryptd_queue_crypt(io);
	kcryptd_queue_crypt(io);