This function can be called with NULL arguments, so check that before
passing to log_error.
(cherry picked from commit e12b72440bcd79f109f14da1ba4c1757800d897c)
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>
(cherry picked from commit 021ba3614f285e62d9f480b438ff374694bea11d)
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>
(cherry picked from commit a9eca8e6025929e3c96199214c69447247e226d8)
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>
(cherry picked from commit ab5ffaf7d01d014f35c83446c2ce263ebaa4e496)
These files are apparently unused, so remove them.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
(cherry picked from commit a02307caf86deba379626fba2f8cb8cc59f1a3ec)
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)
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>
(cherry picked from commit 03045f674c2e910ecebf4ab3695ccf35e015dc92)
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>
(cherry picked from commit 10f483e312fc2ff74dc92247022ede7a86dc2e3c)
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>
(cherry picked from commit 6648d72aebb373ada77784f56ae285540772dc66)
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>
(cherry picked from commit a68435f388a094288e5192314067bccf52da567c)
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>
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>