Commit Graph

2410 Commits

Author SHA1 Message Date
Bart Van Assche
088d743229 scst: Port to CentOS 8
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8591 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-26 04:41:21 +00:00
Bart Van Assche
be309a2e31 scst: Port to SLES 15
Fixes: https://sourceforge.net/p/scst/tickets/29/.

Untested.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8588 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-25 03:33:46 +00:00
Bart Van Assche
842253f87e scst: Port to RHEL 7.7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8586 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-24 21:44:01 +00:00
Bart Van Assche
6b80bb4ca6 scst/ChangeLog: Document changes included in SCST v3.2
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8584 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-15 01:10:50 +00:00
Bart Van Assche
f6371c5d5e Makefiles: Run depmod also on Ubuntu systems after module installation
Fixes: e902f79ecf ("kernel module installation: Skip "depmod" when building an RPM"; r5612)



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8582 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-15 00:29:55 +00:00
Bart Van Assche
35cd068962 scst_vdisk: Set REQ_PRIO for SCSI commands marked as head-of-queue
REQ_PRIO requests preempt others in the CFQ I/O scheduler. REQ_META marks
metadata requests for blktrace.

Reported-by: Lev Vainblat <lev@zadarastorage.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8579 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-07 03:55:23 +00:00
Bart Van Assche
1821c5a2de scst/include/backport.h: Fix kvmalloc() backport for RHEL 7
The kvmalloc function was added in RHEL 7.5. So the backport is
needed for RHEL 7.4 and older. _COMPAT_LINUX_MM_H is checked as
well to avoid a conflict with the appropriate backport in MOFED.

Signed-off-by: Sergey Gorenko <sergeygo@mellanox.com>

[ bvanassche: fixed spelling in commit message ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8578 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-07 03:43:59 +00:00
Bart Van Assche
410c462405 scst_copy_mgr: Fix copy manager LUN wraparound
This patch has been provided by Alexander Sinditskiy. See also
https://sourceforge.net/p/scst/tickets/27/.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8575 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-06 03:38:38 +00:00
Bart Van Assche
59641c1d5f scst: Fix a memory leak
Fix the following Coverity complaint:

CID 344744 (#1 of 1): Resource leak (RESOURCE_LEAK)5. leaked_storage: Variable sioc going out of scope leaks the storage it points to.




git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:55:20 +00:00
Bart Van Assche
9e0914d470 scst_vdisk: Fix a Coverity complaint about integer overflow
Fix the following Coverity complaint:

CID 347914 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)overflow_before_widen: Potentially overflowing expression blocks << cmd->dev->block_shift - 9 with type uint32_t (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type sector_t (64 bits, unsigned).
    
To avoid overflow, cast blocks to type sector_t.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8566 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:54:55 +00:00
Bart Van Assche
8f033f3f9d scst: Backport scsi_cmd_priv()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8565 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:54:15 +00:00
Bart Van Assche
398d41e753 scst: Revert "Increase tgt_dev_cmd_count by one" (r8465)
Because of the previous patch, r8465 is no longer necessary.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-23 03:44:52 +00:00
Bart Van Assche
92c6e461f0 scst: Revert "scst: Free removed LUNs asynchronously" (r8478)
r8478 was not necessary to fix the reported problem. Additionally, it
introduced a new problem, namely that detach_tgt was not called if the
associated device was deleted after the LUN was deleted and before it
was freed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-23 03:43:33 +00:00
Bart Van Assche
4aa7817dbb scst_copy_mgr: Avoid that device deletion sporadically causes a hang
Avoid that deleting a device concurrently with scst_cm_init_inq_finish()
causes command processing to hang.

Reported-by: valera <valer4ik@users.sourceforge.net>
Fixes: 0bb6de9471 ("scst_vdisk: Avoid that LUN refresh triggers a general protection fault" / r7101)


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8515 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:34:04 +00:00
Bart Van Assche
456359e129 scst_copy_mgr: Reduce code duplication
This patch does not change the behavior of the copy manager.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8514 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:33:16 +00:00
Bart Van Assche
e9c16240df scst: Improve several source code comments
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8513 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:32:05 +00:00
Bart Van Assche
f16c5d1b2e scst: Rework scst_prepare_request_sense()
This patch makes the implementation of scst_prepare_request_sense() consistent
with the other code that submits internal commands.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8512 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:31:31 +00:00
Bart Van Assche
dd52454052 scst: Introduce struct scst_icmd_priv
This patch does not change any functionality but improves source code
readability.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-21 21:30:39 +00:00
Bart Van Assche
740f3a6e63 scst: Make device deletion again synchronous
Some scripts that use the SCST sysfs interface depend on filp_close()
having been called before device deletion via the sysfs interface
finishes. Hence make device deletion again synchronous.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8510 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-19 02:59:18 +00:00
Bart Van Assche
377e720b26 scst: Add a trailing newline when showing the cpu_mask sysfs parameter
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8509 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-19 02:58:22 +00:00
Bart Van Assche
59c9780344 ChangeLog: Describe SCST 3.4 changes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8507 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-16 03:19:28 +00:00
Bart Van Assche
cd1a47f85e scst, copy manager: Skip updating if auto CM assignment is disabled
Reported-by: James McCarthy <mccarthy1029@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8504 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-14 23:14:11 +00:00
Bart Van Assche
f2b226ee39 scst, copy manager: Only submit INQUIRY if LUN lookup succeeded
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8503 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-14 23:10:53 +00:00
Bart Van Assche
c6e8013f48 scst: Only free a device after all associated commands and LUNs have finished
Merge scst_free_device() and scst_finally_free_device() into a single
function. Increase dev->refcnt when registering a device or virtual
device. Kill and decrease dev->refcnt when unregistering a device or
virtual device. These changes ensure that a scst_free_device() is
only called after all users (commands and tgt_devs) have stopped
accessing the SCST device.

Fixes: 3f2d50b589 ("scst: Do not suspend command processing when deleting a device"; r8067)



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8501 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-12 01:41:26 +00:00
Bart Van Assche
4e5548c409 scst: Verify dev_exec_cmd_list protection at runtime
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8500 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-12 01:39:37 +00:00
Bart Van Assche
b20c82a521 scst: Complain about unbalanced reference counts in the command processing path
There is no evidence that this is possible. This patch is a debugging help.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8497 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-05 01:44:34 +00:00
Bart Van Assche
5da933cc47 scst: Fix a race condition between LUN translation and LUN removal
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8496 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-05 01:43:41 +00:00
Bart Van Assche
bb7a0fca23 scst: Introduce scst_tgt_dev_dec_cmd_count()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8495 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-05 01:43:03 +00:00
Bart Van Assche
d9d4fe83c5 scst: Queue tgt_dev free work on system_long_wq
scst_free_tgt_dev() waits until pending I/O commands have finished and hence
can take a while.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8487 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-26 01:26:03 +00:00
Bart Van Assche
7c46bc3630 scst: Backport {init,destroy}_rcu_head()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8484 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-25 04:36:15 +00:00
Bart Van Assche
5930b4db71 scst: Fix the MOFED build
Reported-by: Dmitry Popovich <dsp@mvdnet.org>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8479 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-24 15:33:53 +00:00
Bart Van Assche
7426031e91 scst: Free removed LUNs asynchronously
Since scst_free_tgt_dev() is called as soon as the tgt_dev refcount
drops to zero and since scst_del_tgt_dev() decrements that reference
count, remove all scst_free_tgt_dev() calls that follow a
scst_del_tgt_dev() call. Set nr_deleted_tgt_devs in scst_acg_add_lun()
to -1 to avoid that all scst_del_tgt_dev() calls try to free the
associated acg_dev.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8478 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-24 02:19:54 +00:00
Bart Van Assche
cb8873ec0f scst: Micro-optimize scst_del_tgt_dev()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8477 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-24 01:15:19 +00:00
Bart Van Assche
8064fdcf34 scst: Move the code that decrements dev->not_pr_supporting_tgt_devs_num
A later patch will introduce a delay between deleting and freeing a tgt_dev.
Move the code that decrements dev->not_pr_supporting_tgt_devs_num from the
function that frees a tgt_dev into the function that deletes a tgt_dev such
that the decrement code does not get delayed.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8476 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-24 01:13:41 +00:00
Bart Van Assche
0ac23deee2 scst: Introduce tgt_dev.tgtt
A later patch will free tgt_devs after an RCU grace period. Make it
safe to access the target template pointer after an RCU grace period.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8474 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-24 01:09:25 +00:00
Bart Van Assche
89b1c2fb99 scst: Remove a superfluous synchronize_rcu() call
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8473 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-23 21:06:45 +00:00
Bart Van Assche
1a15ee560c scst: Fix __scst_init_cmd()
Fixes: 5b0f9ef0b9 ("scst: Increase tgt_dev_cmd_count by one") / r8465.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8472 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-23 21:06:03 +00:00
Bart Van Assche
98cbaa121f scst: Revert r8466
Since r8466 is causing trouble, revert it temporarily.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8471 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-23 19:18:38 +00:00
Bart Van Assche
cf2167c2b9 scst: Free removed LUNs asynchronously
Instead of waiting until all commands associated with a LUN have finished,
do not wait and free LUN data structures once all associated commands have
finished. This commit should fix https://sourceforge.net/p/scst/tickets/23/.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8466 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-21 01:52:03 +00:00
Bart Van Assche
5b0f9ef0b9 scst: Increase tgt_dev_cmd_count by one
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8465 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-21 01:49:38 +00:00
Bart Van Assche
c9b43e0245 scst: Fix an error path in scst_tgt_dev_setup_threads()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8464 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-21 01:49:03 +00:00
Bart Van Assche
51599b3c44 scst: Move a synchronize_rcu() call from scst_free_tgt_dev() to its callers
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8463 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-21 01:48:21 +00:00
Bart Van Assche
81729121b0 scst: Verify a locking assumption at runtime
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8462 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-21 01:47:49 +00:00
Bart Van Assche
0979cd90e4 scst: Make a comment more clear
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8461 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-21 01:47:11 +00:00
Bart Van Assche
70e055ea0d scst: Fix a Linux kernel v4.10 warning about redefining FC_PORT_ROLE_NVME_INITIATOR
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8433 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-06-20 17:09:32 +00:00
Bart Van Assche
810e718997 scst_vdisk: Make flushing work with the rbd driver
Some but not all block drivers support REQ_OP_FLUSH. Hence use
REQ_OP_WRITE | REQ_PREFLUSH instead. See also
https://github.com/bvanassche/scst/issues/16.

Reported-by: Tomohiro Kusumi
Fixes: d41307c162 ("scst: Port to Linux kernel v4.8") # trunk r6991.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8430 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-06-18 03:00:09 +00:00
Bart Van Assche
3749561e2f scst_vdisk: Invert an if-condition
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8429 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-06-18 02:59:25 +00:00
Bart Van Assche
86fad676e9 scst: Fix build against Linux kernel v5.2
Reported-by: Sebastian Herbszt <herbszt@gmx.de>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8426 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-06-16 21:07:17 +00:00
Bart Van Assche
126cc447db scst: Introduce scst_reset_scsi_target() and scst_reset_scsi_device()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8425 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-06-16 20:53:37 +00:00
Bart Van Assche
5cef085128 scst: Add support for the SCSI SET CAPACITY command
This is a command for tape devices. See also the ANSI T10 SSC document.

Signed-off-by: Rob Turk <robtu@rtist.nl>
[ bvanassche: added patch description ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8422 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-06-14 03:04:26 +00:00