Commit 8371cffe authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Greg Kroah-Hartman

dm mpath: fix stalls when handling invalid ioctls

commit a1989b33 upstream.

An invalid ioctl will never be valid, irrespective of whether multipath
has active paths or not.  So for invalid ioctls we do not have to wait
for multipath to activate any paths, but can rather return an error
code immediately.  This fix resolves numerous instances of:

 udevd[]: worker [] unexpectedly returned with status 0x0100

that have been seen during testing.
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8d8e4839
...@@ -1541,8 +1541,11 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd, ...@@ -1541,8 +1541,11 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd,
/* /*
* Only pass ioctls through if the device sizes match exactly. * Only pass ioctls through if the device sizes match exactly.
*/ */
if (!r && ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) if (!bdev || ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) {
r = scsi_verify_blk_ioctl(NULL, cmd); int err = scsi_verify_blk_ioctl(NULL, cmd);
if (err)
r = err;
}
return r ? : __blkdev_driver_ioctl(bdev, mode, cmd, arg); return r ? : __blkdev_driver_ioctl(bdev, mode, cmd, arg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment