All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm-multipath: Do not stall on invalid ioctls
@ 2014-02-26  9:07 Hannes Reinecke
  2014-02-26 14:56 ` Mike Snitzer
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2014-02-26  9:07 UTC (permalink / raw)
  To: Alasdair Kergon; +Cc: dm-devel, Mike Christie, Mike Snitzer

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 <hare@suse.de>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: dm-multipath: Do not stall on invalid ioctls
  2014-02-26  9:07 [PATCH] dm-multipath: Do not stall on invalid ioctls Hannes Reinecke
@ 2014-02-26 14:56 ` Mike Snitzer
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Snitzer @ 2014-02-26 14:56 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: dm-devel, Mike Christie, Alasdair Kergon

On Wed, Feb 26 2014 at  4:07am -0500,
Hannes Reinecke <hare@suse.de> wrote:

> 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 <hare@suse.de>
> ---
>  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);

I've tweaked the header and code slightly, marked it for stable and
staged it here:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=a1989b330093578ea5470bea0a00f940c444c466

Should be on its way upstream on Friday.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-26 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-26  9:07 [PATCH] dm-multipath: Do not stall on invalid ioctls Hannes Reinecke
2014-02-26 14:56 ` Mike Snitzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.