40 Commits

Author SHA1 Message Date
louhongxiang
e12b72440b iscsid: fixformatoverflowwarning.
This function can be called with NULL arguments, so check that before
passing to log_error.
2023-06-25 14:18:05 +08:00
Wenchao Hao
021ba3614f iscsid: stop connection for recovery if error is not timeout in iscsi_login_eh
When iscsid is reopening a connection, and the reopen process has succeed
to call bind_conn and comes to iscsi_session_set_params() to set
parameters. If the iscsi target trigger another error event(such as
close the socket connection between initiator and target) at this time,
kernel would perform the error handler and set connection's state to
ISCSI_CONN_FAILED, and set kernel iscsi_cls_conn->flags'
ISCSI_CLS_CONN_BIT_CLEANUP bit. Which would make iscsid's
iscsi_session_set_params() failed with ENOTCONN, so iscsi_login_eh()
would be called by iscsid to handle this error.

Now iscsid see conn->state is ISCSI_CONN_STATE_XPT_WAIT and
session->r_stage is R_STAGE_SESSION_REOPEN, so it would call
session_conn_reopen() with do_stop set to 0, which would not trigger
kernel to call iscsi_if_stop_conn() to clear kernel data struct
iscsi_cls_conn->flags' ISCSI_CLS_CONN_BIT_CLEANUP bit.

The reopen would fall into an infinite cycle which looks like
following:

iscsi_conn_connect -> bind_conn(failed with ENOTCONN)

         ^                     |
         |                     |
         |                     v

    session_conn_reopwn(with do_stop set to 0)

The phenomenon is iscsid would always report log "can't bind conn x:0
to session x, retcode -107 (115)" and the session would not recovery.

Fix this issue by checking error type in iscsi_login_eh(), if the error
type is not timeout, make sure we would call session_conn_reopen() with
do_stop set to STOP_CONN_RECOVER.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2023-01-17 17:28:21 +08:00
Wenchao Hao
a9eca8e602 iscsid: clear scanning thread's PR_SET_IO_FLUSHER flag
commit 72949ef (iscsid: set PR_SET_IO_FLUSHER) set the iscsid's
PR_SET_IO_FLUSHER flag to avoid deadlock. While we do not need
to set this flag when scanning host.

If this flag is set for scanning thread, we may lost devices
reported by target because of memory allocation failure.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2023-01-17 17:05:00 +08:00
Wenchao Hao
c3202a63a1 Backport bugfix patches from mainline
Reference:https://github.com/open-iscsi/open-iscsi/commit/fd0b3973
          https://github.com/open-iscsi/open-iscsi/commit/8c6d7bc2

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-12-02 10:51:53 +08:00
Wenchao Hao
ab5ffaf7d0 Substitute self-developed patch with mainline patch
Substitute self-developed patch with mainline patch to fix
nr_sessions do not work during iscsid restart.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-09-27 14:40:50 +08:00
Wenchao Hao
a02307caf8 Remove unused fwparam_ibft.[ch] files in fwparam_ibft.
These files are apparently unused, so remove them.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-06-23 19:10:46 +08:00
Wu Bo
d53ca47385 Backport bugfix patches
Following patches are added:

0017-iscsi-sysfs-check-state-before-onlining-devs.patch
0018-iscsiadm-Call-log_init-first-to-fix-a-segmentation-f.patch
0019-Fix-issues-discovered-by-gcc12.patch
0020-Fix-more-issues-discovered-by-gcc12.patch
0021-actor-enhanced-print-error-log-when-init-a-initilize.patch
0022-initiator_common-make-set-operational-parameter-log-.patch

Signed-off-by: Wu Bo <wubo40@huawei.com>
(cherry picked from commit 36cc8318bb8cb23d09d8a68795f1e97ea0268ffc)
2022-02-18 15:19:00 +08:00
Wenchao Hao
03045f674c 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 <haowenchao@huawei.com>
2022-02-08 19:42:25 +08:00
Wenchao Hao
10f483e312 Remove iscsi-init.service from iscsi and iscsid service file
iscsi-init.service is aimed to generate initiatorname.iscsi,
this name would be generated by spec file in openeulr, so we
excluded the iscsi-init.service.

This commit remove requires of iscsi-init in iscsi.service

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-02-08 18:43:35 +08:00
Wenchao Hao
6648d72aeb Remove unnecessary tool iscsiuio
iscsiuio is used in conjunction with specific linux driver to
improve performance, such as QLogic NetXtreme II or QLogic CNIC driver.
It is not a necessary tool of open-iscsi.

What's more, iscsiuio used a package uio which is out of maintain now,
which would introduce CVEs unhandled. So I want to remove this tool
from open-iscsi.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-01-27 10:14:19 +08:00
Wenchao Hao
b366eabcb3 Remove password printing in session info display
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-01-25 20:10:34 +08:00
Wenchao Hao
a68435f388 Remove iscsid.service of iscsi-init.service
iscsi-init.service is aimed to generate initiatorname.iscsi,
this name would be generated by spec file in openeulr, so we
excluded the iscsi-init.service.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-12-06 10:24:14 +08:00
Wenchao Hao
55a4432e49 iscsi: Update open-iscsi version to 2.1.5-1
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-11-22 10:37:37 +08:00
Wenchao Hao
f37e40e060 Update URL
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-10-21 10:53:57 +08:00
zhouwenpei
2788800e58 remove unnecessary build require. 2021-07-23 16:12:34 +08:00
Wenchao Hao
7d71425ccb Fix file residual files after open-iscsi removed
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-04-08 17:01:50 +08:00
Wenchao Hao
80ff3ed667 Fix iscsiadm segfault when exiting
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-03-01 11:20:39 +08:00
Wenchao Hao
177f8ee7e0 Fix iscsiadm op new report to can not rename error
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-02-22 22:43:21 +08:00
Wenchao Hao
873d6590de iscsi: Update open-iscsi version to 2.1.3-1
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2021-01-29 16:15:36 +08:00
Wenchao Hao
c30f286c34 iscsid: Change iscsid service PIDFile to /run/iscsid.ipd
The pid file has be changed from /var/run/iscsid.pid to
/run/iscsid.pid in code, here perform a sync.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2020-12-12 17:16:06 +08:00
Wenchao Hao
c9c0567638 Remove patched which should not apply
0027-use-openssl-for-random-data-generation.patch and
0028-drop-unused-get_random_bytes.patch can be considered as
feature patches which should not apply

0029-Preparing-for-version-2.1.2.patch should keepace with tar package

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2020-11-20 16:29:02 +08:00
Wenchao Hao
e04742a163 backport patches from epoch2
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2020-11-12 17:28:13 +08:00
wenchao-hao
862d109cb4 backport patches from epoch1 2020-10-31 17:29:53 +08:00
zhangyouming
81fd136d87 backport one patch for solving install problem 2020-09-01 20:14:41 +08:00
wangjun196@huawei.com
e4f6e5e502 Merge branch 'develop' of https://gitee.com/wguanghao/open-iscsi into develop
merge
2020-07-16 18:25:45 +08:00
wangjun196@huawei.com
98867d2f7f rename patches and add changelog 2020-07-15 16:05:16 +08:00
wuguanghao
cc9925b8c1 update open-iscsi version to 2.1.1-1 2020-07-10 14:51:47 +08:00
ZhiqiangLiu
028314e361 open-iscsi: remove useless readme files
open-iscsi: remove useless readme files

Signed-off-by: Zhiqiang Liu <lzhq28@mail.ustc.edu.cn>
2020-07-05 11:41:17 +08:00
si-gui
1d72dac25e Rename 0043-Fix-devel-without-node-header-files.patch to 0045 2020-06-16 09:29:23 +08:00
sigui
59e109870a Merge branch 'master' of gitee.com:src-openeuler/open-iscsi into master 2020-06-16 09:21:22 +08:00
ZhiqiangLiu
58d23e7c3d open-iscsi: backport two upstream bugfix patches 2020-06-15 21:33:35 +08:00
si-gui
b1df6246e6 modify the patch 2020-06-15 17:31:58 +08:00
si-gui
7f1e331130 fix devel without node header files 2020-06-15 15:34:50 +08:00
wubo009
dba849b90a backport bugfix for open-iscsi 2020-05-12 17:27:41 +08:00
sigui
63968a86ab Fix upgrade problem andadd gdb buildrequire. 2020-03-21 21:51:13 +08:00
eulerstorage
2094a0793a remove iscsiuio service 2020-01-21 10:11:12 +08:00
eulerstorage
b350276276 fix service error 2020-01-20 19:45:53 +08:00
eulerstorage
34729d6b18 fix install error 2020-01-17 10:46:36 +08:00
eulerstorage
f017026b1a provide iscsi-initiator-utils-devel 2020-01-11 17:00:05 +08:00
eulerstorage
08550c303d init package 2020-01-09 16:49:50 +08:00