1 Star 0 Fork 28

oooook/open-iscsi

forked from src-openEuler/open-iscsi 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0007-fix-iscsiadm-logout-timeout.patch 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
From c6fbda57e25c154a6dfbd31e9e2f64b9efb3cc43 Mon Sep 17 00:00:00 2001
From: pengyeqing <pengyeqing@huawei.com>
Date: Thu, 28 Jan 2021 15:37:02 +0800
Subject: [PATCH] iscsi-initiator-utils: fix iscsiadm logout timeout
reason:fix iscsiadm logout timeout
Conflict: Adapt for open-iscsi-2.1.3 version
Signed-off-by: pengyeqing <pengyeqing@huawei.com>
---
usr/iscsid_req.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
index a3aba6d..ca32298 100644
--- a/usr/iscsid_req.c
+++ b/usr/iscsid_req.c
@@ -60,6 +60,7 @@ static void iscsid_startup(void)
}
#define MAXSLEEP 128
+#define ISCSID_IPC_WAIT_RESPOND 300
static int ipc_connect(int *fd, char *unix_sock_name, int start_iscsid)
{
@@ -145,7 +146,7 @@ int iscsid_response(int fd, iscsiadm_cmd_e cmd, iscsiadm_rsp_t *rsp,
if (timeout == -1) {
timeout = ISCSID_REQ_TIMEOUT;
- poll_wait = 1;
+ poll_wait = ISCSID_IPC_WAIT_RESPOND;
}
while (len) {
struct pollfd pfd;
@@ -154,8 +155,10 @@ int iscsid_response(int fd, iscsiadm_cmd_e cmd, iscsiadm_rsp_t *rsp,
pfd.events = POLLIN;
err = poll(&pfd, 1, timeout);
if (!err) {
- if (poll_wait)
+ if (poll_wait--)
continue;
+ log_warning("wait %d seconds timeout, try again?",
+ ISCSID_IPC_WAIT_RESPOND);
return ISCSI_ERR_SESSION_NOT_CONNECTED;
} else if (err < 0) {
if (errno == EINTR)
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qu_industry/open-iscsi.git
git@gitee.com:qu_industry/open-iscsi.git
qu_industry
open-iscsi
open-iscsi
master

搜索帮助