The status_byte() macro and also the SAM_STAT_* macros shifted right by one
bit have been removed from kernel v5.14. Hence open-code status_byte() and
change GOOD into SAM_STAT_GOOD etc.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9505 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
Revert this commit since it can cause a deadlock as follows:
- scst_assign_dev_handler() obtains scst_mutex and calls
scst_devt_dev_sysfs_del(). The scst_remove_files() call in the latter
function waits until all dev->dev_kobj sysfs callbacks have finished.
- vdev_sysfs_filename_show() obtains a dev->dev_kobj reference.
- vdev_sysfs_process_get_filename() tries to lock scst_mutex but deadlocks
because scst_assign_dev_handler() is holding scst_mutex.
Fixes: 457d6fceed ("scst, scst_vdisk: Simplify the code for querying the vdisk filename")
Reported-by: Lev Vainblat <lev@zadarastorage.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9375 d57e44dd-8a1f-0410-8b47-8ef2f437770f
HP LTO 3 and later and Oracle/STK T10000 tape drives support the READ MEDIA
SERIALNO command, one of the SERVICE ACTION IN(12) commands.
Signed-off-by: Rob Turk <robtu@rtist.nl>
[ bvanassche: wrote patch description ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9367 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Suppress the following warning:
WARNING: CPU: 0 PID: 6998 at scst/src/scst_copy_mgr.c:2672 scst_cm_update_dev+0xdc/0x110
This warning can be triggered during unregistration of a virtual device with
the following test case:
1. Change a parameter of the virtual device, e.g. the USN.
2. Delete the LUN.
That triggers the following sequence:
1. vdev_del_device()
2. scst_unregister_virtual_device()
3. scst_acg_del_lun()
4. cancel the work struct associated with vdev_inq_changed_fn().
5. visk_detach()
6. vdev_del_device() finishes.
vdev_inq_changed_fn() may get called after a LUN has been unregistered from
the copy manager and before device deletion finishes.
Reported-by: Gleb Chesnokov <Chesnokov.G@raidix.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9341 d57e44dd-8a1f-0410-8b47-8ef2f437770f
From the libiscsi source code:
readcapacity16(sd, &rc16_task, /*alloc_len=*/96, EXPECT_STATUS_GOOD);
Hence increase the limit from 32 to 128.
Fixes: dd467b0eda ("scst: Limit the size of READ CAPACITY buffers")
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9340 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Use shift operations instead of multiplication operations. See also commit
6258844d60 ("scst: fix overflows handling for tapes").
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9331 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Use a percpu_ref instead of one atomic counter per CPU. This patch
eliminates two atomic instructions from the command processing path.
This patch decreases performance for the following configurations
because the backported version of percpu_ref uses a single global
counter:
* RHEL 6.x / CentOS 6.x and before (maintenance ended on 2020-11-30).
* Upstream kernel version v3.10 and before.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9321 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since the next patch will remove cpu_cmd_count, make this decision
independent of cpu_cmd_count.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9320 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Linux kernel commit 4e7b5671c6a8 ("block: remove i_bdev"; v5.11-rc1) removes
the i_bdev member of struct inode. Hence use blkdev_get_by_path() to open
block devices when the struct block_device pointer is needed instead of using
filp_open().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9316 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch breaks the transactional properties of these functions but
makes it easier to port these functions to Linux kernel v5.10.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9315 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Stop looking for trailing whitespace when p == buffer. Remove the local
variable 'pp' since it always equals p + 1.
Fixes: f381dbb74c ("Device sysfs locking reconsidered to remove recently introduced deadlock possibility")
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9311 d57e44dd-8a1f-0410-8b47-8ef2f437770f