summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-02-26 10:07:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-11 16:10:02 -0700
commit8371cffe8a9c704e3d240d5cb73142b6bd62245b (patch)
treef5edd1c9daa90b33aafffab542d17f9df84d5f2d /drivers
parent8d8e4839b5457e20e371a5f7485ce7855c7870c9 (diff)
downloadlwn-8371cffe8a9c704e3d240d5cb73142b6bd62245b.tar.gz
lwn-8371cffe8a9c704e3d240d5cb73142b6bd62245b.zip
dm mpath: fix stalls when handling invalid ioctls
commit a1989b330093578ea5470bea0a00f940c444c466 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: Hannes Reinecke <hare@suse.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-mpath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index b74cb796c17c..9147569545e2 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -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.
*/
- if (!r && ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT)
- r = scsi_verify_blk_ioctl(NULL, cmd);
+ if (!bdev || ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) {
+ int err = scsi_verify_blk_ioctl(NULL, cmd);
+ if (err)
+ r = err;
+ }
return r ? : __blkdev_driver_ioctl(bdev, mode, cmd, arg);
}