]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
block: fix EOD return for device with nr_sectors == 0
authorJens Axboe <axboe@kernel.dk>
Mon, 22 Sep 2025 11:55:41 +0000 (05:55 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 22 Sep 2025 15:35:24 +0000 (09:35 -0600)
commitab073abf6d974d3fe998fc6731ca80e2b57ffd69
tree169af8e48ec78fa5a84bfc13d7754e6afd81d030
parent027a7a9c07d0d759ab496a7509990aa33a4b689c
block: fix EOD return for device with nr_sectors == 0

A recent commit skipped dumping the usual "attempt to access beyond end
of device" message if the device size is 0 sectors, as that's a common
pattern for devices that have been hot removed. But while it stopped
that message, it also prevented returning -EIO for that condition.
Reinstate the -EIO return, while retaining the quiet operation for
triggering EOD for a device with 0 sectors.

Reported-by: syzbot+4b12286339fe4c2700c1@syzkaller.appspotmail.com
Reported-by: Sahil Chandna <chandna.linuxkernel@gmail.com>
Fixes: d0a2b527d8c3 ("block: tone down bio_check_eod")
Tested-by: Sahil Chandna <chandna.linuxkernel@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c