84 Commits

Author SHA1 Message Date
Gleb Chesnokov
163eb9dcc1 scst: Port to Linux kernel v6.15
Support for the following scsi layer changes in the Linux kernel v6.15:

- 0ea163a18b17 ("scsi: usb: Rename the RESERVE and RELEASE constants")
2025-05-14 18:36:46 +03:00
Gleb Chesnokov
b6d1f19437 usr/fileio/common.c: Fix warning for older versions of GCC
Building SCST with an old version of GCC (e.g. 4.8.5 on Centos 7.X)
produces a warning about using initializer.

This is GCC bug # 53119:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119

Hence, use memset() instead of an initializer to avoid this warning.

Fixes: e8b300ef2a ("usr/fileio/common.c: Fix use of uninitialized
struct field")
2023-03-12 21:42:52 +03:00
Gleb Chesnokov
e8b300ef2a usr/fileio/common.c: Fix use of uninitialized struct field
This patch fixes the following Coverity complaint:

    CID 275308 (#1-2 of 2): Uninitialized scalar variable (UNINIT)
    uninit_use_in_call: Using uninitialized value
    multi.multi_cmd.replies_done when calling fprintf.
2022-12-19 12:10:04 +03:00
Bart Van Assche
fda71c077d Include <poll.h> instead of <sys/poll.h>
According to the Single Unix Specification, the poll() function has been
declared in the <poll.h> header file. This makes the SCST code compatible
with the musl C library. See also https://en.wikipedia.org/wiki/Musl. See
also https://github.com/bvanassche/scst/issues/23.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8992 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 03:41:17 +00:00
Bart Van Assche
8ae4d56ad7 usr/fileio/common.c: Annotate a switch/case fall-through
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8360 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-09 16:48:18 +00:00
Bart Van Assche
370e25813e usr/fileio: Make the coding style more consistent
This patch only changes whitespace.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-09 16:25:29 +00:00
Bart Van Assche
9b37ec66b4 usr/fileio/common.c: Fix a compiler warning
Avoid that the compiler complains that the assert() expression compares a
signed with an unsigned integer.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8269 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-21 19:13:35 +00:00
Bart Van Assche
07e936a256 usr/fileio/common.c: Suppress a compiler warning
Avoid that gcc 8 complains about the strncpy() call.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8257 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-20 15:53:53 +00:00
Vladislav Bolkhovitin
f549829482 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7396 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-04-12 03:49:10 +00:00
Vladislav Bolkhovitin
a614104023 usr: fix -Wmissing-prototypes warnings
Fix all twelve [-Wmissing-prototypes] warnings by adding "static" to their
declarations.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7202 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-06-01 04:08:02 +00:00
Vladislav Bolkhovitin
68fa7e1a0d Copyright updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-22 03:19:52 +00:00
Vladislav Bolkhovitin
dd026f8511 fileio_tgt: change "#if DEBUG_TM_FN_IGNORE" to "#ifdef ..."
Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7137 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-19 03:44:20 +00:00
Vladislav Bolkhovitin
55b7684bb7 fileio_tgt: avoid warnings about casting between pointers and integers of different size
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7053 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-16 02:46:49 +00:00
Vladislav Bolkhovitin
43ef6f912f fileio_tgt: fix debug output
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7007 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-11 03:30:54 +00:00
Vladislav Bolkhovitin
fa2f54ac9e Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6787 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-01-22 04:04:43 +00:00
Vladislav Bolkhovitin
3fc775c75a EXTENDED COPY support
Prepared with help from Sushma Gurram <Sushma.Gurram@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6589 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-06 03:58:00 +00:00
Vladislav Bolkhovitin
daee4dcb7e WRITE SAME command improvements
Prepared with help from Sushma Gurram <Sushma.Gurram@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6586 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-06 03:54:23 +00:00
Vladislav Bolkhovitin
af841c5c53 Decrease MULTI_CMDS_CNT for better parallelism
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6516 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-09-18 01:24:10 +00:00
Vladislav Bolkhovitin
90ad49cbae scst_user: optimize performance by exchanging multiple commands/responses per IOCTL
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6466 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-08-08 02:57:14 +00:00
Bart Van Assche
a0e4cc7288 fileio: Remove dead code
There is no FUA bit in WRITE VERIFY commands. Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6344 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 23:45:51 +00:00
Bart Van Assche
502aef7b1b scst: Rename SERVICE_ACTION_IN into SERVICE_ACTION_IN_16
Rename this constant because it has been renamed in the Linux
kernel.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6335 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 20:16:19 +00:00
Vladislav Bolkhovitin
fe38e4acb2 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Vladislav Bolkhovitin
94d1c2fc6c Replace in cases, where sporadic failures are possible, HARDWARE ERROR
by INTERNAL TARGET FAILURE, which is retriable (some OS'es don't retry
HARDWARE ERROR)

Reported and suggested by Shahar Salzman <shahar.salzman@kaminario.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5940 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-19 03:55:14 +00:00
Vladislav Bolkhovitin
c20bc04705 Follow up for r5513
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5516 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-10 03:55:11 +00:00
Vladislav Bolkhovitin
723d233193 Add SYNCHRONIZE_CACHE(16)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5415 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-15 21:30:26 +00:00
Vladislav Bolkhovitin
00851a7501 Merge of adding iSER web page and copyright updates from the iSER branch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Vladislav Bolkhovitin
8a09d515b0 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-23 04:25:27 +00:00
Vladislav Bolkhovitin
10ca1d2f20 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4767 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-20 02:05:29 +00:00
Vladislav Bolkhovitin
16a97e10d1 Silences a compiler warning reported by Richard Sharpe <realrichardsharpe@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4605 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-07 03:07:38 +00:00
Vladislav Bolkhovitin
7f4db4c14b cmd's bufflen and data_len overflow cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-13 20:35:00 +00:00
Vladislav Bolkhovitin
955113f493 Sense handling improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4408 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-07-18 21:28:57 +00:00
Vladislav Bolkhovitin
11dd7dc766 wt_flag handling fixes and improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4337 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-06-07 23:26:07 +00:00
Vladislav Bolkhovitin
201adc197b Follow up for r4334
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4335 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-06-06 01:15:31 +00:00
Vladislav Bolkhovitin
1d2a7e3364 Improve commands parsing and allow uniform LBA decoding as well as changing LBA and transfer length in uniform manner.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4224 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-25 03:11:23 +00:00
Vladislav Bolkhovitin
64699a540a TM handling improvements
TM actions should be done only after all affected commands done to avoid
possibility that any of them be executed with newly set parameters.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4217 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-19 17:46:36 +00:00
Vladislav Bolkhovitin
eb95049061 Copyrights updated + cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4216 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-18 02:26:39 +00:00
Vladislav Bolkhovitin
7d1ba6a2b0 VERIFY(6) is a tape command. T10 has never defined a VERIFY(6) command
for disk or CD-ROM devices, so make sure scst_vdisk rejects it.

+

added the corresponding cleanups in scst_lib.c and fileio/common.c + updated scst_scsi_op_table

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4156 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-03-07 19:50:10 +00:00
Vladislav Bolkhovitin
be49977abb - Change T10 ID and USN generations to get the random part be CRC32 from the device name in the first 8 characters as many MPIO implementations expect
- Cleanup



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3324 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-29 19:08:56 +00:00
Vladislav Bolkhovitin
6d01fda201 Post r3281 cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3282 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-15 13:36:56 +00:00
Vladislav Bolkhovitin
5cd8982545 Custom parse improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3281 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-15 13:09:13 +00:00
Vladislav Bolkhovitin
f3238333dd Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3200 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-01-06 20:02:04 +00:00
Vladislav Bolkhovitin
121a30e9b2 Big CDBs handling improvements.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2295 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-28 13:56:46 +00:00
Vladislav Bolkhovitin
e8f6cfd143 Remove wrong "Unexpected block size" messages
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1814 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-07-13 11:50:27 +00:00
Vladislav Bolkhovitin
8d4d13fdb1 Fix cdb_len handling to avoid crashes on attempts to copy negative cdb_len bytes + minor scst_user residual fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1788 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-25 17:05:36 +00:00
Vladislav Bolkhovitin
085451ada4 ORDERED commands processing cleanup: there's no need to issue flushes for each ORDERED command, because maintaining order of putting data into the cache is sufficient and expected from us. To issue cache flushes initiators supposed to use the cache flushing commands and bits.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1737 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-04 10:28:33 +00:00
Vladislav Bolkhovitin
b53e4cb4c1 Merge of the pr branch with additional fixes for problems found during extra testing
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1714 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-26 17:46:46 +00:00
Bart Van Assche
c99bd720c8 Removed trailing whitespace because checkpatch complained about it.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1671 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-30 10:49:28 +00:00
Vladislav Bolkhovitin
a59f9a0dc6 Residuals handling fixes, part 2
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1667 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-29 17:13:12 +00:00
Vladislav Bolkhovitin
105fd01c57 - Residuals handling fixes, part 1
- Docs updated
 - Cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1666 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-29 14:00:23 +00:00
Vladislav Bolkhovitin
1c21b1ffb8 Minor cleanups, fixes and updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1657 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-27 16:29:58 +00:00