From 03045f674c2e910ecebf4ab3695ccf35e015dc92 Mon Sep 17 00:00:00 2001 From: Wenchao Hao Date: Tue, 8 Feb 2022 19:31:33 +0800 Subject: [PATCH] Remove useless patch remove patch 0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch This patch get iscsid's pid from pidfile /var/run/iscsid.pid, and judge if iscsid is alive according to that pid. While now iscsid.service would not hold a pidfile, so this patch can not work as desired. What's more, iscsiadm would try to connect to iscsid before send request to iscsid, if iscsid is not alive, the connection would failed and return error. At wrost, if iscsid died after connect success, it would timeout after 1 second. And the patch 0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch can not fix this too. Signed-off-by: Wenchao Hao --- ...op-new-report-to-cannot-rename-error.patch | 0 ...t-send-stop-message-if-iscsid-absent.patch | 119 ------------------ ...or-introduced-with-recent-IPv6-commi.patch | 0 ...rvice-s-dependence-of-iscsi-init.ser.patch | 0 ...2-Remove-session-info-password-print.patch | 0 ...csiuio-from-build-and-install-recipe.patch | 0 ... => 0014-Remove-iscsiuio-source-code.patch | 0 ...scsiuio-from-config-and-service-file.patch | 0 ...t.service-from-iscsi-and-iscsid-serv.patch | 0 open-iscsi.spec | 26 ++-- 10 files changed, 14 insertions(+), 131 deletions(-) rename 0010-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch => 0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch (100%) delete mode 100644 0009-not-send-stop-message-if-iscsid-absent.patch rename 0011-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch => 0010-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch (100%) rename 0012-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch => 0011-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch (100%) rename 0013-Remove-session-info-password-print.patch => 0012-Remove-session-info-password-print.patch (100%) rename 0014-Remove-iscsiuio-from-build-and-install-recipe.patch => 0013-Remove-iscsiuio-from-build-and-install-recipe.patch (100%) rename 0015-Remove-iscsiuio-source-code.patch => 0014-Remove-iscsiuio-source-code.patch (100%) rename 0016-Remove-iscsiuio-from-config-and-service-file.patch => 0015-Remove-iscsiuio-from-config-and-service-file.patch (100%) rename 0017-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch => 0016-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch (100%) diff --git a/0010-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch b/0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch similarity index 100% rename from 0010-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch rename to 0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch diff --git a/0009-not-send-stop-message-if-iscsid-absent.patch b/0009-not-send-stop-message-if-iscsid-absent.patch deleted file mode 100644 index 3cafba0..0000000 --- a/0009-not-send-stop-message-if-iscsid-absent.patch +++ /dev/null @@ -1,119 +0,0 @@ -From d99f5bb9a8fcd217262d765b096df30724c774e9 Mon Sep 17 00:00:00 2001 -From: pengyeqing -Date: Mon, 20 Jan 2020 19:43:52 +0800 -Subject: [PATCH] iscsi-initiator-utils: not send stop message if iscsid absent - -Conflict: 1. Remove modification about iscsid.service, these modification are - in 0009-Modify-iscsid.service-to-keep-same-with-previous-ver.patch - 2. change log_error("iscsid %d maybe ...) to - log_error("iscsid %ld maybe ...) to avoid compile failure - -Signed-off-by: pengyeqing ---- - usr/iscsiadm.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 71 insertions(+) - -diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c -index f2bd721..b386abe 100644 ---- a/usr/iscsiadm.c -+++ b/usr/iscsiadm.c -@@ -69,6 +69,8 @@ static char program_name[] = "iscsiadm"; - static char config_file[TARGET_NAME_MAXLEN]; - extern struct iscsi_ipc *ipc; - -+#define ISCSIPID_LEN 256 -+ - enum iscsiadm_mode { - MODE_DISCOVERY, - MODE_DISCOVERYDB, -@@ -267,11 +269,52 @@ str_to_portal_type(char *str) - return ptype; - } - -+/** -+ * get_content() - Utility function to read hex values from sysfs -+ * @param pidfile - path to use -+ * @parm buf - this is the value returned from the entry -+ * @return 0 on success <0 on failure -+ * @note: buf[] return without '\0' -+ */ -+static int get_file_content(const char *pidfile, char buf[], int buflen) -+{ -+ int rc = 0; -+ FILE *fp = NULL; -+ size_t chars_read = 0; -+ -+ fp = fopen(pidfile, "r"); -+ if (fp == NULL) { -+ log_error("Could not open path: %s [%s]", -+ pidfile, strerror(errno)); -+ rc = -EIO; -+ goto error_fopen; -+ } -+ -+ chars_read = fread(buf, 1, buflen, fp); -+ if ((chars_read <= 0) && ferror(fp)) { -+ log_error("Could not read from: %s [%s]", -+ pidfile, strerror(ferror(fp))); -+ rc = -EIO; -+ goto error; -+ } -+ -+error: -+ fclose(fp); -+ -+error_fopen: -+ return rc; -+} -+ - static void kill_iscsid(int priority, int tmo) - { - iscsiadm_req_t req; - iscsiadm_rsp_t rsp; - int rc; -+ char *pTmp = NULL; -+ char iscsidpid[ISCSIPID_LEN] = {0}; -+ char procpid[ISCSIPID_LEN] = {0}; -+ char cmdline[ISCSIPID_LEN] = {0}; -+ char iscsidcmdline[ISCSIPID_LEN] = {0}; - - /* - * We only support SIGTERM like stoppage of iscsid for now. -@@ -287,6 +330,34 @@ static void kill_iscsid(int priority, int tmo) - return; - } - -+ /* if pid of iscsid is present, go on; or return directly */ -+ rc = get_file_content(PID_FILE, iscsidpid, ISCSIPID_LEN); -+ if (rc != 0) { -+ return; -+ } -+ -+ snprintf(procpid, ISCSIPID_LEN, "/proc/%ld/cmdline", atol(iscsidpid)); -+ -+ rc = get_file_content(procpid, cmdline, ISCSIPID_LEN); -+ if (rc != 0) { -+ return; -+ } -+ -+ snprintf(iscsidcmdline, ISCSIPID_LEN, "%s", cmdline); -+ -+ pTmp = strstr(iscsidcmdline, "iscsid"); -+ if (NULL == pTmp) { -+ log_error("iscsid pid mismatch proc cmdline, pid:%ld, cmdline:%s.\n", atol(iscsidpid), iscsidcmdline); -+ return; -+ } else { -+ rc = kill(atol(iscsidpid), 0); -+ if (ESRCH == rc) { -+ log_error("iscsid %ld maybe in zombie.\n", atol(iscsidpid)); -+ return; -+ } -+ } -+ /* end */ -+ - memset(&req, 0, sizeof(req)); - req.command = MGMT_IPC_IMMEDIATE_STOP; - rc = iscsid_exec_req(&req, &rsp, 0, tmo); --- -1.8.3.1 - diff --git a/0011-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch b/0010-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch similarity index 100% rename from 0011-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch rename to 0010-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch diff --git a/0012-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch b/0011-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch similarity index 100% rename from 0012-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch rename to 0011-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch diff --git a/0013-Remove-session-info-password-print.patch b/0012-Remove-session-info-password-print.patch similarity index 100% rename from 0013-Remove-session-info-password-print.patch rename to 0012-Remove-session-info-password-print.patch diff --git a/0014-Remove-iscsiuio-from-build-and-install-recipe.patch b/0013-Remove-iscsiuio-from-build-and-install-recipe.patch similarity index 100% rename from 0014-Remove-iscsiuio-from-build-and-install-recipe.patch rename to 0013-Remove-iscsiuio-from-build-and-install-recipe.patch diff --git a/0015-Remove-iscsiuio-source-code.patch b/0014-Remove-iscsiuio-source-code.patch similarity index 100% rename from 0015-Remove-iscsiuio-source-code.patch rename to 0014-Remove-iscsiuio-source-code.patch diff --git a/0016-Remove-iscsiuio-from-config-and-service-file.patch b/0015-Remove-iscsiuio-from-config-and-service-file.patch similarity index 100% rename from 0016-Remove-iscsiuio-from-config-and-service-file.patch rename to 0015-Remove-iscsiuio-from-config-and-service-file.patch diff --git a/0017-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch b/0016-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch similarity index 100% rename from 0017-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch rename to 0016-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch diff --git a/open-iscsi.spec b/open-iscsi.spec index 9174daf..1691cf9 100644 --- a/open-iscsi.spec +++ b/open-iscsi.spec @@ -4,7 +4,7 @@ Name: open-iscsi Version: 2.1.5 -Release: 5 +Release: 6 Summary: ISCSI software initiator daemon and utility programs License: GPLv2+ and BSD URL: http://www.open-iscsi.com @@ -17,15 +17,14 @@ patch5: 0005-do-not-sync-session-when-a-session-is-already-created.patch patch6: 0006-fix-default-file-corrupt.patch patch7: 0007-fix-iscsiadm-logout-timeout.patch patch8: 0008-default-file-zero-after-power-outage.patch -patch9: 0009-not-send-stop-message-if-iscsid-absent.patch -patch10: 0010-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch -patch11: 0011-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch -patch12: 0012-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch -patch13: 0013-Remove-session-info-password-print.patch -patch14: 0014-Remove-iscsiuio-from-build-and-install-recipe.patch -patch15: 0015-Remove-iscsiuio-source-code.patch -patch16: 0016-Remove-iscsiuio-from-config-and-service-file.patch -patch17: 0017-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch +patch9: 0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch +patch10: 0010-Fix-compiler-error-introduced-with-recent-IPv6-commi.patch +patch11: 0011-Remove-iscsid.service-s-dependence-of-iscsi-init.ser.patch +patch12: 0012-Remove-session-info-password-print.patch +patch13: 0013-Remove-iscsiuio-from-build-and-install-recipe.patch +patch14: 0014-Remove-iscsiuio-source-code.patch +patch15: 0015-Remove-iscsiuio-from-config-and-service-file.patch +patch16: 0016-Remove-iscsi-init.service-from-iscsi-and-iscsid-serv.patch BuildRequires: flex bison doxygen kmod-devel systemd-units gcc git isns-utils-devel systemd-devel BuildRequires: autoconf automake libtool libmount-devel openssl-devel pkg-config @@ -152,10 +151,13 @@ fi %{_mandir}/man8/* %changelog -* Tue Feb 8 2021 haowenchao - 2.1.5-5 +* Tue Feb 8 2022 haowenchao - 2.1.5-6 +- Remove useless patch + +* Tue Feb 8 2022 haowenchao - 2.1.5-5 - Remove iscsi's dependence of iscsid-init.service -* Thu Jan 26 2022 haowenchao - 2.1.5-4 +* Wed Jan 26 2022 haowenchao - 2.1.5-4 - Remove tool iscsiuio * Tue Jan 25 2022 haowenchao - 2.1.5-3