[dm-devel] IBM request to allow unprivledged ioctls [Was: Revert "dm mpath: fix stalls when handling invalid ioctls"]
Paolo Bonzini
pbonzini at redhat.com
Sat Oct 31 15:33:59 UTC 2015
On 29/10/2015 14:18, Mike Snitzer wrote:
> > 4) dmesg shows that scsi_verify_blk_ioctl() failed for SG_IO (0x2285);
> > it returns -ENOIOCTLCMD, later replaced with -ENOTTY in vfs_ioctl().
> >
> > $ dmesg
> > <...>
> > [] device-mapper: multipath: Failing path 65:144.
> > [] device-mapper: multipath: Failing path 67:144.
> > [] device-mapper: multipath: Failing path 65:224.
> > [] device-mapper: multipath: Failing path 68:32.
> > [] sgio_inquiry: sending ioctl 2285 to a partition!
>
> So scsi_verify_blk_ioctl() considers the ioctl invalid.
But that's wrong, I think. It's a false positive in
scsi_verify_blk_ioctl().
If the ioctl is valid when bdev becomes non-NULL (and it will be if
ti->len becomes equal to i_size_read(bdev->bd_inode) >> SECTOR_SHIFT),
you should not return -ENOIOCTLCMD aka ENOTTY, because userspace doesn't
think the ioctls can go away and come back. So Hannes's patch broke the
userspace ABI. :(
Paolo
More information about the dm-devel
mailing list