Thread (8 messages) 8 messages, 3 authors, 2024-04-05

Re: regression on BLKRRPART ioctl for EIO

From: Saranya Muruganandam <hidden>
Date: 2024-02-27 02:38:43

Possibly related (same subject, not in this thread)

Hi,
Is there advice on how to fix this `blockdev --rereadpt` regression in
the kernel?
Would appreciate some advice.

Thanks,
Saranya


On Mon, Feb 12, 2024 at 8:01 PM Saranya Muruganandam
[off-list ref] wrote:
When we fail to read from the disk, BLKRRPART used to be able to
capture and bubble this up to the caller.
It no longer does since we no longer capture the error from bdev_disk_changed.

Here is an example with fault-injection:

# echo 0 > /sys/kernel/debug/fail_make_request/interval
# echo 100 > /sys/kernel/debug/fail_make_request/probability
# echo -1 > /sys/kernel/debug/fail_make_request/times
# echo 1 > /sys/block/sdc/make-it-fail
# blockdev --rereadpt /dev/sdc # no error
# echo $?
0 # incorrectly reports success.

Whereas fdisk and sfdisk correctly report the issue :

# sfdisk /dev/sdc
sfdisk: cannot open /dev/sdc: Input/output error
# fdisk /dev/sdc

Welcome to fdisk (util-linux 2.28.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open /dev/sdc: Input/output error

Best,
Saranya



On Mon, Feb 12, 2024 at 8:00 PM Saranya Muruganandam
[off-list ref] wrote:
quoted
When we fail to read from the disk, BLKRRPART used to be able to capture and bubble this up to the caller.
It no longer does since we no longer capture the error from bdev_disk_changed.

Here is an example with fault-injection:

# echo 0 > /sys/kernel/debug/fail_make_request/interval
# echo 100 > /sys/kernel/debug/fail_make_request/probability
# echo -1 > /sys/kernel/debug/fail_make_request/times
# echo 1 > /sys/block/sdc/make-it-fail
# blockdev --rereadpt /dev/sdc # no error
# echo $?
0 # incorrectly reports success.

Whereas fdisk and sfdisk correctly report the issue :

# sfdisk /dev/sdc
sfdisk: cannot open /dev/sdc: Input/output error
# fdisk /dev/sdc

Welcome to fdisk (util-linux 2.28.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open /dev/sdc: Input/output error

Best,
Saranya

On Mon, Feb 12, 2024 at 7:44 AM Christoph Hellwig [off-list ref] wrote:
quoted
What scenario are you looking at?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help