On Wed, Aug 23, 2023 at 12:48:13PM +0200, Jan Kara wrote: > diff --git a/block/ioctl.c b/block/ioctl.c > index 648670ddb164..54c1e2f71031 100644 > --- a/block/ioctl.c > +++ b/block/ioctl.c > @@ -582,7 +582,8 @@ long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg) > { > struct block_device *bdev = I_BDEV(file->f_mapping->host); > void __user *argp = (void __user *)arg; > - blk_mode_t mode = file_to_blk_mode(file); > + struct bdev_handle *bdev_handle = file->private_data; > + blk_mode_t mode = bdev_handle->mode; > int ret; > > switch (cmd) { Still the same bug as in v2 - you are missing the effects of fcntl(2) setting/clearing O_NDELAY and sd_ioctl() is sensitive to that.