49 lines
1.3 KiB
Diff
49 lines
1.3 KiB
Diff
From 521637e6e1274fbecd8c588681b24f628e2eec97 Mon Sep 17 00:00:00 2001
|
|
From: pengyeqing <pengyeqing@huawei.com>
|
|
Date: Sun, 27 Jan 2019 00:16:18 +0800
|
|
Subject: [PATCH] iscsi-initiator-utils: fix iscsiadm logout timeout
|
|
|
|
reason:fix iscsiadm logout timeout
|
|
|
|
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 78000f4..18bb9db 100644
|
|
--- a/usr/iscsid_req.c
|
|
+++ b/usr/iscsid_req.c
|
|
@@ -64,6 +64,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)
|
|
{
|
|
@@ -147,7 +148,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;
|
|
@@ -159,8 +160,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_ISCSID_NOTCONN;
|
|
} else if (err < 0) {
|
|
if (errno == EINTR)
|
|
--
|
|
1.8.3.1
|
|
|