Skip to content

Commit 0b39ca4

Browse files
Carlos Llamasaxboe
authored andcommitted
blk-crypto: use BLK_STS_INVAL for alignment errors
Make __blk_crypto_bio_prep() propagate BLK_STS_INVAL when IO segments fail the data unit alignment check. This was flagged by an LTP test that expects EINVAL when performing an O_DIRECT read with a misaligned buffer [1]. Cc: Eric Biggers <[email protected]> Cc: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ [1] Signed-off-by: Carlos Llamas <[email protected]> Reviewed-by: Eric Biggers <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 19de03b commit 0b39ca4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ bool __blk_crypto_bio_prep(struct bio **bio_ptr)
292292
}
293293

294294
if (!bio_crypt_check_alignment(bio)) {
295-
bio->bi_status = BLK_STS_IOERR;
295+
bio->bi_status = BLK_STS_INVAL;
296296
goto fail;
297297
}
298298

0 commit comments

Comments
 (0)