diff mbox

[3/9] dm-mpath: don't call scsi_dh_attach when we want to retain the attached handler

Message ID 1430415151-30948-4-git-send-email-hch@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig April 30, 2015, 5:32 p.m. UTC
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/md/dm-mpath.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

Comments

Mike Snitzer April 30, 2015, 6:25 p.m. UTC | #1
On Thu, Apr 30 2015 at  1:32pm -0400,
Christoph Hellwig <hch@lst.de> wrote:

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  drivers/md/dm-mpath.c | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> index 9fb91ca..f6d40d3 100644
> --- a/drivers/md/dm-mpath.c
> +++ b/drivers/md/dm-mpath.c
> @@ -591,9 +591,7 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
>  			kfree(m->hw_handler_params);
>  			m->hw_handler_params = NULL;
>  		}
> -	}
> -
> -	if (m->hw_handler_name) {
> +	} else if (m->hw_handler_name) {
>  		/*
>  		 * Increments scsi_dh reference, even when using an
>  		 * already-attached handler.
> @@ -604,15 +602,15 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
>  			dm_put_device(ti, p->path.dev);
>  			goto bad;
>  		}
> +	}
>  
> -		if (m->hw_handler_params) {
> -			r = scsi_dh_set_params(q, m->hw_handler_params);
> -			if (r < 0) {
> -				ti->error = "unable to set hardware "
> -							"handler parameters";
> -				dm_put_device(ti, p->path.dev);
> -				goto bad;
> -			}
> +	if (m->hw_handler_name && m->hw_handler_params) {
> +		r = scsi_dh_set_params(q, m->hw_handler_params);
> +		if (r < 0) {
> +			ti->error = "unable to set hardware "
> +						"handler parameters";
> +			dm_put_device(ti, p->path.dev);
> +			goto bad;
>  		}
>  	}
>  

Would prefer to see the old weird error message line wrapping fixed up
to be on a single line (80 cols be damned).

Acked-by: Mike Snitzer <snitzer@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Reinecke May 1, 2015, 7:10 a.m. UTC | #2
On 04/30/2015 07:32 PM, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Martin K. Petersen May 1, 2015, 3:34 p.m. UTC | #3
>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:

+	} else if (m->hw_handler_name) {
 		/*
 		 * Increments scsi_dh reference, even when using an
 		 * already-attached handler.

Shouldn't this comment be updated to reflect your previous patch?
Christoph Hellwig May 1, 2015, 4:46 p.m. UTC | #4
On Fri, May 01, 2015 at 11:34:25AM -0400, Martin K. Petersen wrote:
> +	} else if (m->hw_handler_name) {
>  		/*
>  		 * Increments scsi_dh reference, even when using an
>  		 * already-attached handler.
> 
> Shouldn't this comment be updated to reflect your previous patch?

Yes, it should.  I'll fix it for the resend.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 9fb91ca..f6d40d3 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -591,9 +591,7 @@  static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
 			kfree(m->hw_handler_params);
 			m->hw_handler_params = NULL;
 		}
-	}
-
-	if (m->hw_handler_name) {
+	} else if (m->hw_handler_name) {
 		/*
 		 * Increments scsi_dh reference, even when using an
 		 * already-attached handler.
@@ -604,15 +602,15 @@  static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
 			dm_put_device(ti, p->path.dev);
 			goto bad;
 		}
+	}
 
-		if (m->hw_handler_params) {
-			r = scsi_dh_set_params(q, m->hw_handler_params);
-			if (r < 0) {
-				ti->error = "unable to set hardware "
-							"handler parameters";
-				dm_put_device(ti, p->path.dev);
-				goto bad;
-			}
+	if (m->hw_handler_name && m->hw_handler_params) {
+		r = scsi_dh_set_params(q, m->hw_handler_params);
+		if (r < 0) {
+			ti->error = "unable to set hardware "
+						"handler parameters";
+			dm_put_device(ti, p->path.dev);
+			goto bad;
 		}
 	}