linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi:libiscsi:Fix an error count for active session
@ 2020-03-25  6:53 wubo (T)
  2020-03-26 17:35 ` Lee Duncan
  2020-03-27  2:50 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: wubo (T) @ 2020-03-25  6:53 UTC (permalink / raw)
  To: Lee Duncan, Chris Leech, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, open-iscsi, linux-kernel
  Cc: linfeilong, liuzhiqiang (I)

From: Wu Bo <wubo40@huawei.com>

Fix an error count for active session if the total_cmds is invalid 
on the function iscsi_session_setup().
decrement the number of active sessions before the func return.

Signed-off-by: Wu Bo <wubo40@huawei.com>
---
 drivers/scsi/libiscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 70b99c0..b7158eb 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2771,7 +2771,7 @@ struct iscsi_cls_session *
                       "must be a power of 2.\n", total_cmds);
                total_cmds = rounddown_pow_of_two(total_cmds);
                if (total_cmds < ISCSI_TOTAL_CMDS_MIN)
-                       return NULL;
+                       goto dec_session_count;
                printk(KERN_INFO "iscsi: Rounding can_queue to %d.\n",
                       total_cmds);
        }
--
1.8.3.1

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

* Re: [PATCH] scsi:libiscsi:Fix an error count for active session
  2020-03-25  6:53 [PATCH] scsi:libiscsi:Fix an error count for active session wubo (T)
@ 2020-03-26 17:35 ` Lee Duncan
  2020-03-27  2:50 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Duncan @ 2020-03-26 17:35 UTC (permalink / raw)
  To: wubo (T),
	Chris Leech, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, open-iscsi, linux-kernel
  Cc: linfeilong, liuzhiqiang (I)

On 3/24/20 11:53 PM, wubo (T) wrote:
> From: Wu Bo <wubo40@huawei.com>
> 
> Fix an error count for active session if the total_cmds is invalid 
> on the function iscsi_session_setup().
> decrement the number of active sessions before the func return.
> 
> Signed-off-by: Wu Bo <wubo40@huawei.com>
> ---
>  drivers/scsi/libiscsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index 70b99c0..b7158eb 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -2771,7 +2771,7 @@ struct iscsi_cls_session *
>                        "must be a power of 2.\n", total_cmds);
>                 total_cmds = rounddown_pow_of_two(total_cmds);
>                 if (total_cmds < ISCSI_TOTAL_CMDS_MIN)
> -                       return NULL;
> +                       goto dec_session_count;
>                 printk(KERN_INFO "iscsi: Rounding can_queue to %d.\n",
>                        total_cmds);
>         }
> --
> 1.8.3.1
> 

Reviewed-by: Lee Duncan <lduncan@suuse.com>

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

* Re: [PATCH] scsi:libiscsi:Fix an error count for active session
  2020-03-25  6:53 [PATCH] scsi:libiscsi:Fix an error count for active session wubo (T)
  2020-03-26 17:35 ` Lee Duncan
@ 2020-03-27  2:50 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-03-27  2:50 UTC (permalink / raw)
  To: wubo (T)
  Cc: Lee Duncan, Chris Leech, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, open-iscsi, linux-kernel,
	linfeilong, liuzhiqiang (I)


wubo,

> Fix an error count for active session if the total_cmds is invalid on
> the function iscsi_session_setup().  decrement the number of active
> sessions before the func return.

Applied to 5.7/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-03-27  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25  6:53 [PATCH] scsi:libiscsi:Fix an error count for active session wubo (T)
2020-03-26 17:35 ` Lee Duncan
2020-03-27  2:50 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).