From: Hannes Reinecke Subject: [PATCH] dm-multipath: Do not stall on invalid ioctls Date: Wed, 26 Feb 2014 10:07:04 +0100 Message-ID: <1393405624-46796-1-git-send-email-hare@suse.de> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Alasdair Kergon Cc: dm-devel@redhat.com, Mike Christie , Mike Snitzer List-Id: dm-devel.ids An invalid ioctl is an invalid ioctl, irrespective on whether multipath has active paths or not. And for invalid ioctls we do not have to wait for multipath to activate any paths, but can rather return the error code immediately. This resolves numerous instances of udevd[]: worker [] unexpectedly returned with status 0x0100 we have seen during testing. Signed-off-by: Hannes Reinecke --- drivers/md/dm-mpath.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 6eb9dc9..e8431fb 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1626,8 +1626,13 @@ 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; + + err = scsi_verify_blk_ioctl(NULL, cmd); + if (err) + r = err; + } if (r == -ENOTCONN && !fatal_signal_pending(current)) queue_work(kmultipathd, &m->process_queued_ios); -- 1.7.12.4