Commit Graph

8366 Commits

Author SHA1 Message Date
Arian Weber
dcfa2cf4ca Reenable block_shift calculation for tapes
The calculation of block_shift was disabled for tape devices.
Enabling it again, as it is now being used in scst_tape_generic_parse.

Fixes: 0043f510cb ("block shift cleanups and fixes")
2021-09-01 20:19:30 +02:00
Bart Van Assche
6aa46747e2 Merge branch 'svn-trunk' 2021-08-27 10:58:36 -07:00
Bart Van Assche
d5cee6ebf4 Makefile: Make sure that $(KVER) and $(KDIR) are set
These variables are needed for building Debian packages.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9496 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-27 17:58:27 +00:00
Bart Van Assche
27a74601a5 Makefile, dpkg: Show $(KVER) and $(KDIR) while building a Debian package
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9495 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-27 17:57:47 +00:00
Bart Van Assche
8042466117 scstadmin/init.d/scst: Remove the 'which' invocation
Remove the invocation of the 'which' command since that command has been
deprecated in Debian 11 and since I am not aware of any other portable
approach for querying the path of a command.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9494 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-27 17:56:28 +00:00
Bart Van Assche
78a12a523f Merge branch 'svn-trunk' 2021-08-19 20:36:28 -07:00
Bart Van Assche
5dd069d3d6 scst: Do not affect weak updates during installation
The code for removing weak updates did not fix the reported issue.
Additionally, that code can remove weak updates that are not related to
SCST. Hence remove the code again that removes weak updates.

Reported-by: Tu, Rongqing <rongqing.tu@hpe.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9493 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-20 03:36:16 +00:00
Bart Van Assche
878f4fa45e Merge branch 'svn-trunk' 2021-08-18 21:15:23 -07:00
Bart Van Assche
c11f216fed scst_copy_mgr: Fix support for auto_cm_assignment=0
Only check whether a LUN has already been registered with the copy manager
for the auto_cm_assignment=1 case since with auto CM assignment disabled
scst_cm_dev_register() is called after the LUN has been registered.

Reported-by: Eitan Cohen <eitancohen456@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9492 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-19 04:15:16 +00:00
Bart Van Assche
6691b60c39 scst: Fix copy manager LUN assignment for auto_cm_assignment=0
The INQUIRY command sent by the copy manager can only succeed if the LUN it
is submitted to exists before the INQUIRY command is sent. Hence this patch
that swaps the order of the scst_cm_on_add_lun() and scst_alloc_add_tgt_dev()
calls in scst_acg_add_lun(). This patch prevents that the INQUIRY commands
submitted by the copy manager fail as follows:

Not supported dev type 7f, ignoring

Reported-by: Eitan Cohen <eitancohen456@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9491 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-19 04:12:36 +00:00
Bart Van Assche
df8d3d223a Debian: Fix Makefile syntax for 'make dpkg'
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9490 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-19 04:11:11 +00:00
Bart Van Assche
19ed0903d8 Merge pull request #45 from yocalebo/fix-debian-rules
Fix debian/rules syntax error
2021-08-18 16:05:14 -07:00
caleb
34a1a2e90e fix debian/rules syntax error 2021-08-17 09:40:21 -04:00
Bart Van Assche
549c58e784 Merge branch 'svn-trunk' 2021-08-15 11:35:18 -07:00
Bart Van Assche
0e43a7eb8f nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9489 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-15 18:35:08 +00:00
Bart Van Assche
c0b7ce6985 Merge branch 'svn-trunk' 2021-08-13 20:24:50 -07:00
Bart Van Assche
84d335f131 scst_local: Make the SCSI host number available in sysfs
An example for the following SCST configuration:

TARGET_DRIVER scst_local {
	TARGET scst_local_tgt {
		session_name scst_local_host

		LUN 0 dummy
		LUN 1 test1
		LUN 2 test2
	}
}
    
$ cat /sys/kernel/scst_tgt/targets/scst_local/scst_local_tgt/sessions/scst_local_host/host_no
9


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9488 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2021-08-14 03:24:11 +00:00
Bart Van Assche
0281c79e8d Merge branch 'svn-trunk' 2021-07-13 07:03:57 -07:00
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
ba294a12ba Merge branch 'svn-trunk' 2021-07-12 21:52:29 -07: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
7fc6af2934 Merge branch 'svn-trunk' 2021-07-11 20:45:53 -07: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
6e432da586 Merge branch 'svn-trunk' 2021-07-11 20:13:46 -07: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
626851afcb Merge branch 'svn-trunk' 2021-07-08 21:33:20 -07: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
46ecdbe8a9 Merge branch 'svn-trunk' 2021-07-08 21:02:38 -07: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
4077eff364 Merge branch 'svn-trunk' 2021-07-08 20:30:42 -07: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
7c2f118c2b Merge branch 'svn-trunk' 2021-07-01 17:55:05 -07: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
842bfb1d66 Merge branch 'svn-trunk' 2021-06-24 20:14:55 -07: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
19eef9bc27 Merge branch 'svn-trunk' 2021-06-22 15:54:05 -07: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
a476ad06ba Merge branch 'svn-trunk' 2021-06-20 20:29:08 -07: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