On Mon, Jul 24, 2023 at 08:23:26PM +0200, Andrey Albershteyn wrote: > > +# open a file descriptor for reading the file > > +exec 3< $SCSI_DEBUG_MNT/testfile > > + > > +# delete the scsi debug device while it still has dirty data > > +echo 1 > /sys/block/$(_short_dev $SCSI_DEBUG_DEV)/device/delete > > + > > +# try to read from the file, which should give us -EIO > > +cat <&3 > /dev/null > > hmm, maybe I missing something but won't cat always return -EIO > here? I suppose the test will also pass without the behaviour you > introduced. What do you mean with always? If the file system isn't shut down the read could succeed, and it could return a different error. Right now btrfs for example will not return -EIO here.