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 <saranyamohan@xxxxxxxxxx> 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 7:44 AM Christoph Hellwig <hch@xxxxxx> wrote: >> >> What scenario are you looking at?