Commit Graph

7243 Commits

Author SHA1 Message Date
Bart Van Assche
d6a342b373 isert-scst: Call isert_portal_list_add() after portal initialization
This patch fixes the following hang:

SysRq : Show Blocked State
  task                        PC stack   pid father
iscsi-scstd   D 0000000000000007     0  7981      1 0x00000084
 ffff88007ad87ae8 0000000000000046 0000000000000000 0000000000000010
 0000000000000246 ffff88007ad87a48 0000002483e71851 0000000000000246
 00000000fffdd081 0000000000000c83 ffff880078e8b068 ffff88007ad87fd8
Call Trace:
 [<ffffffffa050667d>] isert_wait_for_portal_release+0x6d/0xc0 [isert_scst]
 [<ffffffffa04fd5cd>] isert_close_all_portals+0x3d/0x50 [isert_scst]
 [<ffffffffa04deeca>] target_del_all+0x9a/0x2b0 [iscsi_scst]
 [<ffffffffa04d7688>] iscsi_release+0x48/0xe0 [iscsi_scst]
 [<ffffffff811a46c8>] __fput+0xf8/0x220
 [<ffffffff811a4815>] fput+0x25/0x30
 [<ffffffff8119f8d0>] filp_close+0x60/0x90
 [<ffffffff81084ccf>] put_files_struct+0x7f/0xf0
 [<ffffffff81084d93>] exit_files+0x53/0x70
 [<ffffffff81086ecd>] do_exit+0x18d/0x860
 [<ffffffff810875f8>] do_group_exit+0x58/0xd0
 [<ffffffff8109d576>] get_signal_to_deliver+0x1f6/0x470
 [<ffffffff8100a375>] do_signal+0x75/0x8d0
 [<ffffffff8100ac60>] do_notify_resume+0x90/0xc0
 [<ffffffff8156672f>] int_signal+0x12/0x17

Fixes: 5d808c54 ("isert-scst: Introduce the function isert_setup_id()")
Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: added call stack ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9487 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-13 14:03:15 +00:00
Bart Van Assche
53559bae31 isert-scst: Move a statement that reports an error message
Move PRINT_ERROR to the body of RDMA_CM_EVENT_CONNECT_REQUET because only
it can return an error and not log information about it.

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[bvanassche: modified patch title]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9486 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-13 04:52:18 +00:00
Bart Van Assche
a4b3805d11 scstadmin: Improve performance of make_path()
Since `make_path` is called in pretty much any interaction with sysfs,
speed degradation in it has visible impact when plenty of resources
being managed. So much that it reaches the same great execution time as
calls to filesystem, such as `-d`.

Reported-by: Dyadyushkin Aleksandr <dyadyushkin.a@raidix.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9485 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 03:45:32 +00:00
Bart Van Assche
6abef3d29c isert-scst: Fix handling of RDMA_CV_EVENT_ADDR_CHANGE
During processing RDMA_CM_EVENT_ADDR_CHANGE event rdma_bind_addr in isert_setup_id function from isert_cm_evt_listener_handler returns error -98 [EADDRINUSE].
In principle, it is logical, because at that time the socket address was still bound to the old cma_id which will be destroyed via rdma_destroy_id only after processing the RDMA_CM_EVENT_ADDR_CHANGE event.

Move the creation of the cma_id in workqueue context and delete old cma_id directly, not through returning the error code to the upper level.

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9484 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 03:12:48 +00:00
Bart Van Assche
7517bd6b22 isert-scst: Add support for handling RDMA_CV_EVENT_ADDR_CHANGE
Re-create the portal RDMA CM ID if the address of that port changes.

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: edited patch description ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9483 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 03:11:18 +00:00
Bart Van Assche
c67a1535dc isert-scst: Remove isert_portal_listen()
Remove this function since it is no longer used.

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: edited patch description ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9482 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 03:09:07 +00:00
Bart Van Assche
5d808c5432 isert-scst: Introduce the function isert_setup_id()
Introduce the function isert_setup_id(). This function creates and sets up
an RDMA CM ID. Move the isert_portal_listen() call into isert_portal_create().

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: edited patch description and dropped support for older kernel
  versions in the PRINT_INFO() statement ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9481 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 03:06:25 +00:00
Bart Van Assche
6cfbb697fd isert-scst: Properly release resources on DEVICE_REMOVAL
When the low level driver exercises the hot unplug they would call
rdma_cm cma_remove_one which would fire DEVICE_REMOVAL event to all cma
consumers. Now, if consumer doesn't make sure they destroy all IB
objects created on that IB device instance prior to finalizing all
processing of DEVICE_REMOVAL callback, rdma_cm will let the lld to
de-register with IB core and destroy the IB device instance. And if the
consumer calls (say) ib_dereg_mr(), it will crash since that dev object
is NULL.

In the current implementation, iser-target just initiates the cleanup
and returns from DEVICE_REMOVAL callback. This deferred work creates a
race between iser-target cleaning IB objects(say MR) and lld destroying
IB device instance.

This patch includes the following fixes
  -> make sure that consumer frees all IB objects associated with device
     instance
  -> return non-zero from the callback to destroy the rdma_cm id

Signed-off-by: Raju Rangoju <rajur@chelsio.com>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>

See also upstream commit 63b268d232b8 ("IB/isert: Properly release
resources on DEVICE_REMOVAL")

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: edited patch description and moved a break statement into a code
  block ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9480 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 02:41:47 +00:00
Bart Van Assche
4ab077523a isert-scst: Rename multiple functions and one structure member
Minimize the diffs with the upstream code base by performing the following
renames:
isert_conn_free()         --> isert_put_conn()
isert_conn_free_do_work() --> isert_release_work()
isert_kref_free()         --> isert_release_kref()
isert_conn->free_work     --> isert_conn->release_work

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: edited patch description ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9479 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 02:36:36 +00:00
Bart Van Assche
5aac2b4602 isert-scst: Introduce isert_conn_init()
Minimize the diffs with the upstream code base by introducing the function
isert_conn_init().

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: edited patch description ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9478 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 02:21:59 +00:00
Bart Van Assche
5af1ed474b isert-scst: Rename struct isert_connection into struct isert_conn
Minimize the diffs with upstream.

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9477 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-12 02:20:32 +00:00
Bart Van Assche
1a329a7a8c isert-scst: Fix the CentOS 7 build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9476 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-09 04:33:13 +00:00
Bart Van Assche
f4208c44be isert-scst: Use rdma_event_msg() if it is available
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9475 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-09 04:01:11 +00:00
Bart Van Assche
8019c8cd3d isert-scst: Simplify the code that reports that a connection has been accepted
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9474 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-09 03:30:28 +00:00
Bart Van Assche
5b4f387943 isert-scst: Minimize diffs with upstream
Move the isert_cm_disconnect_handler() definition, pass the event type to
isert_cm_evt_listener_handler() instead of the struct rdma_cm_event pointer
and change the return value of isert_cm_evt_listener_handler() from 0 /
-EINVAL into -1.

Signed-off-by: Chesnokov Gleb <Chesnokov.G@raidix.com>
[ bvanassche: made the patch description more detailed ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9473 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-09 03:15:30 +00:00
Bart Van Assche
2a775c4231 scst: Port to Linux kernel v5.13
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9472 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-02 00:54:43 +00:00
Bart Van Assche
a31d58a49d nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9471 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-07-02 00:35:28 +00:00
Bart Van Assche
ce54530cd2 scripts/kernel-functions: Revert r9445
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9469 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-25 03:13:47 +00:00
Bart Van Assche
e98bc30e42 debian/scst.dkms: Switch to the qla2x00t-32gbit driver
Fixes: 1cfa1e7f87 ("Makefile: switch to qla-32gbit by default")


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9448 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-22 22:53:55 +00:00
Bart Van Assche
ce4afb414a Makefile: Fix the scst-dkms-rpm build
Fixes: 1cfa1e7f87 ("Makefile: switch to qla-32gbit by default")



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9447 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-21 03:28:58 +00:00
Bart Van Assche
b7fc83cbdd nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9446 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-21 03:26:58 +00:00
Bart Van Assche
f3c567b4ce nightly build: Improve support for CentOS 8.4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9445 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-21 03:26:20 +00:00
Bart Van Assche
124edd624f nightly build: Add support for CentOS 8.4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9444 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-21 03:25:39 +00:00
Bart Van Assche
393c65fbf1 scst: Port to CentOS 8.4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9443 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-21 03:23:02 +00:00
Bart Van Assche
caf127e37e debian/scst.dkms: Switch to the qla2x00t-32gbit driver
Fixes: 1cfa1e7f87 ("Makefile: switch to qla-32gbit by default")



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9442 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-21 03:05:47 +00:00
Bart Van Assche
ba27441096 debian/rules: Fail the build if $(QLA_INI_DIR) has not been set
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9441 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-21 03:04:27 +00:00
Bart Van Assche
05afc999f1 scstadmin: Fix a bug in the code for forcibly applying a configuration
Pass the -force option from ... to removeGroup().

Signed-off-by: YuFan Chen <wiz.chen@gmail.com>
[ bvanassche: added commit message ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9440 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-06-18 04:45:40 +00:00
Bart Van Assche
b3aabb0b8e debian/rules: Use $(KVER) instead of $(uname -r)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9439 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 03:01:15 +00:00
Bart Van Assche
7aade0a109 Makefile: Make the qla2x00t-32gbit driver the default QLogic FC driver
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9438 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 02:59:52 +00:00
Bart Van Assche
27a6c65bf3 Temporarily revert r9436
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9437 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 02:58:28 +00:00
Bart Van Assche
8f792b0abd debian/rules: Use $(KVER) instead of $(uname -r)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9436 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 02:53:12 +00:00
Bart Van Assche
b7ed3f8e77 Makefile: switch to qla-32gbit by default
Bart Van Assche noted that currently there are more people using the
32gbit driver than there are people using the older one. So it might
make sense to finally make switch and default to the 32gbit driver.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9435 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 02:52:04 +00:00
Bart Van Assche
6787c12e95 Makefile: add ability to enable qla-32gbit target
Although qla-32gbit is mentioned in the README, but there wasn't really a
way to enable it sans editing the code.
    
This commit adds an ability to enable the driver by passing
`QLA_32GBIT=y` variable at build time.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9434 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 02:51:45 +00:00
Bart Van Assche
3d957ec708 Temporarily revert r9432
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9433 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 02:50:01 +00:00
Bart Van Assche
50f78c67ea debian/rules: Use $(KVER) instead of $(uname -r)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9432 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-31 02:45:26 +00:00
Bart Van Assche
7381de4fb9 Add a github action for building SCST upon push and upon a pull request
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9431 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-29 01:17:50 +00:00
Bart Van Assche
af9504a0f5 iscsi-scst/usr/Makefile: Use -Werror when testing a compiler option
This is necessary for clang.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9430 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-29 01:16:42 +00:00
Bart Van Assche
237910043b debian/rules: Only build fcst if libfc has been enabled in the kernel
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9429 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-29 01:15:57 +00:00
Bart Van Assche
aa3f402314 Makefile: Conditionally regenerate the source code archives
Only regenerate the source code archives if one of the included source files
has been modified.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9428 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-23 20:41:30 +00:00
Bart Van Assche
bbbeb7ebf4 debian: Follow-up for the previous 5 commits
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9427 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-20 04:04:12 +00:00
Bart Van Assche
bbc5c25445 debian: make sure CC variable is passed through to the build
See also https://github.com/bvanassche/scst/pull/37.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9426 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-20 04:02:37 +00:00
Bart Van Assche
2de5765c9c debian: make sure depmod uses the correct version
By default it uses the currently running kernel, which is not necessary
the kernel the package was built for. Fix this by generating the path on
package creation stage.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9425 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-20 04:02:06 +00:00
Bart Van Assche
fc2135c345 debian: fix wrong kernel version used in preinst
This script is used in the non-dkms scst package. The purpose of package
is to determine kernel location at compile-time, as opposed to the
package installation time. However, calling `uname -r` in package
installation time violates that idea because it would get some random
kernel that was running on the machine. This problem is particularly
seen in containers, because in those `uname` shows the kernel running on
the host, rather than the one running inside container.

Fix this by determining the kernel location in `preinst` script at
compile time as well.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9424 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-20 04:01:46 +00:00
Bart Van Assche
143ea7b546 debian: make sure KVER and KDIR are visible to dpkg build
The debuild clears up the environment, thus the essential SCST variables
KVER and KDIR are cleared out. This patch fixes it.

Note: technically, `debild` supports `--preserve-env` option. But in
reality making use of it makes no difference, variables still do not
appear. Work around it by using DEB_foo_SET from `man dpkg-buildflags`


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9423 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-20 04:01:24 +00:00
Bart Van Assche
ffad8bd07a Makefile: remove an always false condition
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9422 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-20 04:01:00 +00:00
Bart Van Assche
ccdb440ae4 qla2x00t: Always check the qla2x00_wait_for_hba_online() return value
This patch suppresses the following Coverity complaint:

CID 364334 (#1 of 1): Unchecked return value (CHECKED_RETURN)
6. check_return: Calling qla2x00_wait_for_hba_online without checking return
   value (as is done elsewhere 8 out of 10 times).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9421 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-19 14:12:39 +00:00
Bart Van Assche
f94a74fc14 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9420 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-19 14:10:52 +00:00
Bart Van Assche
2be2a4701a scripts/specialize-patch: Evaluate 0 && defined(...) as 0
Fixes: 7b375842e9 ("qla2x00t-32gbit: Fix two recently introduced build errors")



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9419 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-19 14:10:26 +00:00
Bart Van Assche
21e987fa8e qla2x00t-32gbit: Compilation fix for kernel versions before v5.12
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9418 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-18 05:06:30 +00:00
Bart Van Assche
9a9fdf179f qla2x00t-32gbit: Prevent PRLI in target mode
In a case when the initiator in P2P mode by some circumstances does not
send PRLI, the target, in a case when the target port's WWPN is less than
initiator's, changes the discovery state in DSC_GNL. When gnl completes it
sends PRLI to the initiator.

Usually the initiator in P2P mode always sends PRLI. We caught this issue
on Linux stable v5.4.6 https://www.spinics.net/lists/stable/msg458515.html.

Fix this particular corner case in the behaviour of the P2P mod target
login state machine.

Link: https://lore.kernel.org/r/20210422153414.4022-1-a.kovaleva@yadro.com
Fixes: a9ed06d4e640 ("scsi: qla2xxx: Allow PLOGI in target mode")
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Anastasia Kovaleva <a.kovaleva@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit fcb16d9a8ecf1e9bfced0fc654ea4e2caa7517f4 upstream ]



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9417 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-05-15 22:59:36 +00:00