diff options
| author | Carlos Llamas <cmllamas@google.com> | 2025-10-30 04:39:18 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-12-01 11:43:36 +0100 |
| commit | 1f0f07fd8f4130852022297aa5e68df6780ccc25 (patch) | |
| tree | 211323f56d62d3d613d6f06a94dd0cb3e9307fba /block | |
| parent | 74bf749662a2930c7319a98dfddc4d647cc8c1c0 (diff) | |
| download | linux-1f0f07fd8f4130852022297aa5e68df6780ccc25.tar.gz linux-1f0f07fd8f4130852022297aa5e68df6780ccc25.tar.bz2 linux-1f0f07fd8f4130852022297aa5e68df6780ccc25.zip | |
blk-crypto: use BLK_STS_INVAL for alignment errors
[ Upstream commit 0b39ca457241aeca07a613002512573e8804f93a ]
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 <ebiggers@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/all/aP-c5gPjrpsn0vJA@google.com/ [1]
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block')
| -rw-r--r-- | block/blk-crypto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-crypto.c b/block/blk-crypto.c index 4d760b092deb..7a0bd086a194 100644 --- a/block/blk-crypto.c +++ b/block/blk-crypto.c @@ -282,7 +282,7 @@ bool __blk_crypto_bio_prep(struct bio **bio_ptr) } if (!bio_crypt_check_alignment(bio)) { - bio->bi_status = BLK_STS_IOERR; + bio->bi_status = BLK_STS_INVAL; goto fail; } |
