[PATCH] scsi:libiscsi:Fix an error count for active session

6 views
Skip to first unread message

wubo (T)

unread,
Mar 25, 2020, 2:53:38 AM3/25/20
to Lee Duncan, Chris Leech, James E.J. Bottomley, Martin K. Petersen, linux...@vger.kernel.org, open-...@googlegroups.com, linux-...@vger.kernel.org, linfeilong, liuzhiqiang (I)
From: Wu Bo <wub...@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 <wub...@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

Lee Duncan

unread,
Mar 26, 2020, 1:40:26 PM3/26/20
to wubo (T), Chris Leech, James E.J. Bottomley, Martin K. Petersen, linux...@vger.kernel.org, open-...@googlegroups.com, linux-...@vger.kernel.org, linfeilong, liuzhiqiang (I)
Reviewed-by: Lee Duncan <ldu...@suuse.com>

Martin K. Petersen

unread,
Mar 26, 2020, 10:50:16 PM3/26/20
to wubo (T), Lee Duncan, Chris Leech, James E.J. Bottomley, Martin K. Petersen, linux...@vger.kernel.org, open-...@googlegroups.com, linux-...@vger.kernel.org, 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
Reply all
Reply to author
Forward
0 new messages