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")
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
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
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
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
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
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
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
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
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
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
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