Commit Graph

8750 Commits

Author SHA1 Message Date
Gleb Chesnokov
6e096cba99 qla2x00t-32gbit: Wind down adapter after PCIe error
Put adapter into a wind down state if OS does not make any attempt to
recover the adapter after PCIe error.

Link: https://lore.kernel.org/r/20220616053508.27186-4-njavali@marvell.com
Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit d3117c83ba31 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
ba83b3a49b qla2x00t-32gbit: Add a new v2 dport diagnostic feature
FW requires minimum 72 bytes buffer size for D_port result. Buffer size
1024 is mentioned in the FW spec so buffer size is increased to 1024.
Rewrite the logic to handle START/RESTART command from SDMAPI.

Link: https://lore.kernel.org/r/20220616053508.27186-3-njavali@marvell.com
Signed-off-by: Bikash Hazarika <bhazarika@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 476da8faa336 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
ae2c0e208a qla2x00t-32gbit: Fix excessive I/O error messages by default
Disable printing I/O error messages by default.  The messages will be
printed only when logging was enabled.

Link: https://lore.kernel.org/r/20220616053508.27186-2-njavali@marvell.com
Fixes: 8e2d81c6b5be ("scsi: qla2xxx: Fix excessive messages during device logout")
Cc: stable@vger.kernel.org
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit bff4873c7090 upstream ]
2022-09-13 11:29:40 +03:00
Gleb Chesnokov
92a731d0d7 qla2x00t-32gbit: Update version to 10.02.07.600-k
Link: https://lore.kernel.org/r/20220608115849.16693-11-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0f4d7d556125 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
1c26699006 qla2x00t-32gbit: edif: Fix slow session teardown
User experience slow recovery when target device went through a stop/start
of the authentication application (app_stop/app_start).

Between the period of app_stop and app_start on the target device, target
device choose to send ELS Reject for any receive AUTH ELS command.  At this
time, authentication application does not do ELS reject if it encounters
error.

Therefore, AUTH ELS reject signify authentication application is not
running. If driver passes up the AUTH ELS Reject to the authentication
application, then it would result in authentication application
retrying/resending the same AUTH ELS command again + delay.

As a work around, driver should trigger a session tear down where it tells
the local authentication application to also tear down.  At the next
relogin, both sides are then synchronized.

Link: https://lore.kernel.org/r/20220608115849.16693-10-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit bcf536072f74 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
3d0b662f7a qla2x00t-32gbit: edif: Reduce N2N thrashing at app_start time
For N2N + remote WWPN is bigger than local adapter, remote adapter will
login to local adapter while authentication application is not running.
When authentication application starts, the current session in FW needs to
to be invalidated.

Make sure the old session is torn down before triggering a relogin.

Link: https://lore.kernel.org/r/20220608115849.16693-9-njavali@marvell.com
Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 37be3f9d6993 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
9866511082 qla2x00t-32gbit: edif: Fix no logout on delete for N2N
The driver failed to send implicit logout on session delete. For edif, this
failed to flush any lingering SA index in FW.

Set a flag to turn on implicit logout early in the session recovery to make
sure the logout will go out in case of error.

Link: https://lore.kernel.org/r/20220608115849.16693-8-njavali@marvell.com
Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit ec538eb838f3 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
93238e0580 qla2x00t-32gbit: edif: Fix session thrash
Current code prematurely sends out PRLI before authentication application
has given the OK to do so. This causes PRLI failure and session teardown.

Prevents PRLI from going out before authentication app gives the OK.

Link: https://lore.kernel.org/r/20220608115849.16693-7-njavali@marvell.com
Fixes: 91f6f5fbe87b ("scsi: qla2xxx: edif: Reduce connection thrash")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit a8fdfb0b39c2 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
b9505ddcf8 qla2x00t-32gbit: edif: Tear down session if keys have been removed
If all keys for a session have been deleted, trigger a session teardown.

Link: https://lore.kernel.org/r/20220608115849.16693-6-njavali@marvell.com
Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit d7e2e4a68fc0 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
f4ec5bf693 qla2x00t-32gbit: edif: Fix no login after app start
The scenario is this: User loaded driver but has not started authentication
app. All sessions to secure device will exhaust all login attempts, fail,
and in stay in deleted state. Then some time later the app is started. The
driver will replenish the login retry count, trigger delete to prepare for
secure login. After deletion, relogin is triggered.

For the session that is already deleted, the delete trigger is a no-op. If
none of the sessions trigger a relogin, no progress is made.

Add a relogin trigger.

Link: https://lore.kernel.org/r/20220608115849.16693-5-njavali@marvell.com
Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 24c796098f53 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
8f8331fe93 qla2x00t-32gbit: edif: Reduce disruption due to multiple app start
Multiple app start can trigger a session bounce. Make driver skip over
session teardown if app start is seen more than once.

Link: https://lore.kernel.org/r/20220608115849.16693-4-njavali@marvell.com
Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0dbfce5255fe upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
14b62dbee3 qla2x00t-32gbit: edif: Send LOGO for unexpected IKE message
If the session is down and the local port continues to receive AUTH ELS
messages, the driver needs to send back LOGO so that the remote device
knows to tear down its session. Terminate and clean up the AUTH ELS
exchange followed by a passthrough LOGO.

Link: https://lore.kernel.org/r/20220608115849.16693-3-njavali@marvell.com
Fixes: 225479296c4f ("scsi: qla2xxx: edif: Reject AUTH ELS on session down")
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 2b659ed67a12 upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
d48d24f4ef qla2x00t-32gbit: edif: Fix I/O timeout due to over-subscription
The current edif code does not keep track of FW IOCB resources.  This led
to IOCB queue full on error recovery (I/O timeout).  Make use of the
existing code that tracks IOCB resources to prevent over-subscription.

Link: https://lore.kernel.org/r/20220608115849.16693-2-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 63ab6cb582fa upstream ]
2022-09-13 11:15:41 +03:00
Gleb Chesnokov
09950e41b5 qla2x00t-32gbit: Update version to 10.02.07.500-k
Link: https://lore.kernel.org/r/20220607044627.19563-12-njavali@marvell.com
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 4dc48a107a14 upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
9152b4740a qla2x00t-32gbit: edif: Fix n2n login retry for secure device
After initiator has burned up all login retries, target authentication
application begins to run. This triggers a link bounce on target side.
Initiator will attempt another login. Due to N2N, the PRLI [nvme | fcp] can
fail because of the mode mismatch with target. This patch add a few more
login retries to revive the connection.

Link: https://lore.kernel.org/r/20220607044627.19563-11-njavali@marvell.com
Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit aec55325ddec upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
bf6504c1e4 qla2x00t-32gbit: edif: Fix n2n discovery issue with secure target
User failed to see disk via n2n topology. Driver used up all login retries
before authentication application started. When authentication application
started, driver did not have enough login retries to connect securely. On
app_start, driver will reset the login retry attempt count.

Link: https://lore.kernel.org/r/20220607044627.19563-10-njavali@marvell.com
Fixes: 4de067e5df12 ("scsi: qla2xxx: edif: Add N2N support for EDIF")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 789d54a41786 upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
51acb6f8f8 qla2x00t-32gbit: edif: Remove old doorbell interface
Recently driver has implemented a new doorbell mechanism via bsg.  The new
doorbell tells driver the exact buffer size application has where driver
can fill it up with events. The old doorbell guestimated application buffer
size is 256.

Remove duplicate functionality, the application has moved on to the new
doorbell interface.

Link: https://lore.kernel.org/r/20220607044627.19563-9-njavali@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 1040e5f75ddf upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
b805073c83 qla2x00t-32gbit: edif: Add retry for ELS passthrough
Relating to EDIF, when sending IKE message, updating key or deleting key,
driver can encounter IOCB queue full. Add additional retries to reduce
higher level recovery.

Link: https://lore.kernel.org/r/20220607044627.19563-8-njavali@marvell.com
Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 0b3f3143d473 upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
7118ccf7c4 qla2x00t-32gbit: edif: Synchronize NPIV deletion with authentication application
Notify authentication application of a NPIV deletion event is about to
occur. This allows app to perform cleanup.

Link: https://lore.kernel.org/r/20220607044627.19563-7-njavali@marvell.com
Fixes: 9efea843a906 ("scsi: qla2xxx: edif: Add detection of secure device")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit cf79716e6636 upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
b3cc9f3628 qla2x00t-32gbit: edif: Fix potential stuck session in sa update
When a thread is in the process of reestablish a session, a flag is set to
prevent multiple threads/triggers from doing the same task. This flag was
left on, and any attempt to relogin was locked out. Clear this flag if the
attempt has failed.

Link: https://lore.kernel.org/r/20220607044627.19563-6-njavali@marvell.com
Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit e0fb8ce2bb9e upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
c3b8db1d41 qla2x00t-32gbit: Backport to older kernel versions
The commit ec325c9913bd ("qla2x00t-32gbit: edif: Add bsg interface to
read doorbell events") introduced the use of the sg_copy_buffer()
function.

The kernel has only exported this function since version v4.2, so use
sg_pcopy_from_buffer() instead, which is already supported by older
kernel versions.
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
8f0b70f56f qla2x00t-32gbit: edif: Add bsg interface to read doorbell events
Add bsg interface for app to read doorbell events. This interface lets
driver know how much app can read based on return buffer size. When the
next event(s) occur, driver will return the bsg_job with the event(s) in
the return buffer.

If there is no event to read, driver will hold on to the bsg_job up to few
seconds as a way to control the polling interval.

Link: https://lore.kernel.org/r/20220607044627.19563-5-njavali@marvell.com
Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 5ecd241bd7b1 upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
eb5f7c5a2c qla2x00t-32gbit: edif: Wait for app to ack on sess down
On session deletion, wait for app to acknowledge before moving on. This
allows both app and driver to stay in sync. In addition, this gives a
chance for authentication app to do any type of cleanup before moving on.

Link: https://lore.kernel.org/r/20220607044627.19563-4-njavali@marvell.com
Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit df648afa39da upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
fe93ca4c50 qla2x00t-32gbit: edif: bsg refactor
- Add version field to edif bsg for future enhancement.

 - Add version edif bsg version check

 - Remove unused interfaces and fields.

Link: https://lore.kernel.org/r/20220607044627.19563-3-njavali@marvell.com
Fixes: dd30706e73b7 ("scsi: qla2xxx: edif: Add key update")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 7a7b0b4865d3 upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
b5561a6b4a qla2x00t-32gbit: edif: Reduce Initiator-Initiator thrashing
This patch uses GFFID switch command to scan whether remote device is
Target or Initiator mode.  Based on that info, driver will not pass up
Initiator info to authentication application. This helps reduce unnecessary
stress for authentication application to deal with unused connections.

Link: https://lore.kernel.org/r/20220607044627.19563-2-njavali@marvell.com
Fixes: 7ebb336e45ef ("scsi: qla2xxx: edif: Add start + stop bsgs")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 9c40c36e75ff upstream ]
2022-09-13 10:49:31 +03:00
Gleb Chesnokov
1807f82e39 scst_mem: Check for errors in scst_sgv_pools_init()
The register_shrinker() function may return an error since Linux
kernel v3.12.
2022-09-12 23:31:25 +03:00
Gleb Chesnokov
a13ef3be90 scst_mem: Allow NULL 'pool' pointer in sgv_pool_destroy()
sgv_pool_destroy() does not tolerate a NULL sgv_pool pointer argument and
performs a NULL-pointer dereference. This requires additional attention
and effort from developers/reviewers and forces all sgv_pool_destroy()
callers to do a NULL check

    if (pool)
        sgv_pool_destroy(pool);

Or, otherwise, be invalid sgv_pool_destroy() users.

Tweak sgv_pool_destroy() and NULL-check the pointer there.
2022-09-12 23:31:25 +03:00
Gleb Chesnokov
96f5cfb7b3 scst/include/backport.h: Fix the register_shrinker() backport
The register_shrinker() function has begun to return non void value since
v3.12 version. So fix the backport of this function for kernel versions
before v3.12.

Fixes: 84bd33f9a1 ("scst_mem: Port to Linux kernel v6.0")
2022-09-12 23:31:25 +03:00
Gleb Chesnokov
4f1003104f iscsi-scst: Fix a typo in SCSTTarget RA
Extraneous space in "status" breaks resource monitoring:

    <action name="status " timeout="10" interval="10" depth="0" />

Fixes: https://github.com/SCST-project/scst/issues/80
2022-09-01 12:42:52 +03:00
Gleb Chesnokov
84bd33f9a1 scst_mem: Port to Linux kernel v6.0
Support for the following mm layer changes in the Linux kernel v6.0:
- e33c267ab70d ("mm: shrinkers: provide shrinkers with names")
2022-08-21 19:41:49 +03:00
Gleb Chesnokov
46ad98f072 scst: Remove else after a break or return
Remove the else because the if statement has a break or return statement.

This patch fixes the following checkpatch warnings:

    WARNING:UNNECESSARY_ELSE: else is not generally useful after a break
    or return.
2022-08-09 19:38:00 +03:00
Gleb Chesnokov
ebae8bd223 scst: Remove unnecessary null check
kmem_cache_destroy() can handle NULL pointer correctly, so there is no need
to check NULL pointer before calling kmem_cache_destroy().

For kernel versions before v4.3 there is a backport of
kmem_cache_destroy() that checks for a null pointer.

This patch fixes the following checkpatch warnings:

    WARNING:NEEDLESS_IF: kmem_cache_destroy(NULL) is safe and this check
    is probably not required
2022-08-09 19:38:00 +03:00
Gleb Chesnokov
4649a6abd4 scst/include/backport.h, scst_sysfs: Prefer 'unsigned int' over bare 'unsigned'
The bare "unsigned" type implicitly means "unsigned int", but the preferred
coding style is to use the complete type name.

This patch fixes the following checkpatch warnings:

    WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
2022-08-09 19:38:00 +03:00
Gleb Chesnokov
1e168e6676 iscsi-scst: Fix spelling mistake in comment
Change 'compability' to 'compatibility'.

This patch fixes the following checkpatch warning:

    WARNING: 'compability' may be misspelled - perhaps 'compatibility'?
2022-08-09 19:38:00 +03:00
Gleb Chesnokov
d94c7fb06e scst_lib, scst_vdisk: Remove unlikely from IS_ERR_OR_NULL
This patch fixes the following checkpatch warnings:

    WARNING:LIKELY_MISUSE: nested (un)?likely() calls,
    IS_ERR_OR_NULL already uses unlikely() internally.
2022-08-09 19:38:00 +03:00
Gleb Chesnokov
b4e09bac10 nightly build: Update kernel versions 2022-08-02 15:17:10 +03:00
Gleb Chesnokov
7b55903875 mailmap: Update Gleb Chesnokov's email address
I have created a new dedicated email address for SCST. So add
information about it.

New email: gleb.chesnokov@scst.dev
2022-07-29 21:42:15 +03:00
Bart Van Assche
6641fa81bf ib_srpt: Remove the obsolete max_sge_delta kernel module parameter 2022-07-27 20:17:03 -07:00
Bart Van Assche
4b7b3e2c58 ib_srpt: Remove obsolete parameters and update documentation
Support for the ib_srpt_target_<n> target port names was removed in 2015.
Update the documentation that still uses this target port name format.
Remove all references to the obsolete ib_srpt kernel module parameters
use_port_guid_in_session_name and use_node_guid_in_target_name. Remove
the references from srpt/README to target port name formats that are no
longer supported.
2022-07-27 20:14:23 -07:00
Gleb Chesnokov
8ac0b4e6b4 scst_lib: Fix memory leak reported by Coverity
This patch fixes the following Coverity complaint:

    CID 275306 (#1 of 1): Resource leak (RESOURCE_LEAK)
    Variable cwrp going out of scope leaks the storage it points to.

In the scst_cmp_wr_local() function, we don't free 'cwrp' if the next
check after the memory allocation fails. Hence move this check before
allocating memory.

Fixes: 4525b04b2 ("scst: Reject inconsistent COMPARE AND WRITE commands")
2022-07-26 18:43:34 +03:00
Gleb Chesnokov
60e0a15f41 README.md: Use the preferred way to integrate the Coverity Scan Badge 2022-07-26 16:11:11 +03:00
Gleb Chesnokov
fabd3dadc9 github: Ignore errors when building SCST for Coverity
The GitHub virtual environment provides Ubuntu with a kernel that doesn't
support FCoE, causing the build to fail:

ERROR: modpost: "fc_seq_release" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_fc4_register_provider" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_lport_iterate" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_seq_els_rsp_send" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_seq_assign" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "_fc_frame_alloc" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_fill_reply_hdr" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_exch_done" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_fc4_deregister_provider" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
ERROR: modpost: "fc_frame_alloc_fill" [/root/gleb/SCST/scst/fcst/fcst.ko] undefined!
WARNING: modpost: suppressed 4 unresolved symbol warnings because there were too many)

Ignore these errors and continue building SCST to get all the information
for analysis.
2022-07-26 16:11:11 +03:00
Gleb Chesnokov
b6b23e9a0c README.md: Add Coverity Scan Badge 2022-07-25 14:41:32 +03:00
Gleb Chesnokov
4418538578 github: Add a GitHub action to run a Coverity scan upon push
Submit a build to the Coverity analyzer for every change in the
master branch.

You can find the results of Coverity's analysis here:
https://scan.coverity.com/projects/scst-project
2022-07-25 14:41:32 +03:00
Gleb Chesnokov
5c7fa24031 Makefile: Introduce the 'make cov-build'
Introduce a new helper target to build the SCST for the Coverity scan.
2022-07-25 14:41:32 +03:00
Gleb Chesnokov
1db47d2a3e scst_main: Fix up the error handling
We should clear sysfs during copy manager device registration failure.
Otherwise, we will not be able to re-register this device, since the
sysfs for it has already been created.
2022-07-23 20:46:21 +03:00
Gleb Chesnokov
4a02996629 scst_copy_mgr, initial inquiry: Fix up the error handling
1. scst_cm_send_init_inquiry() gets a reference on struct scst_device, but
   doesn't put it in case of an error, so this may cause a reference leak.

2. scst_cm_init_inq_finish() shouldn't put a reference on struct
   scst_device during the retry, since we have to hold the reference as
   long as there is a pointer to struct scst_device in the priv field.
   Otherwise, the retry command will run without holding the reference.

Fixes: ec3c6b5a ("scst_copy_mgr, initial inquiry: Hold a reference on
struct scst_device")
2022-07-23 20:46:21 +03:00
Gleb Chesnokov
f06a86e4aa scstadmin/scstadmin.sysfs/Makefile: Add makefile target
Most targets of this Makefile require a underlying Makefile to be
created before they are called. Otherwise you will get an error like
this:

  make -C scst-1.0.0 clean
  make[3]: Entering directory '/.../scst/scstadmin/scstadmin.sysfs/scst-1.0.0'
  make[3]: *** No rule to make target 'clean'.  Stop.

Hence add a target that creates a underlying Makefile and add it as a
dependency for all required targets.
2022-07-12 19:34:18 +03:00
Gleb Chesnokov
fa8f125ed8 scst_vdisk: Introduce the primitives for [de]activating a virt device
Currently we have several places where activating/deactivating of
virtual device happens:

  1. sysfs 'active' attribute
  2. on_alua_state_change_*() callback functions

They all use the same code to activate/deactivate virtual device.

Hence introduce the new vdisk_activate_dev() and vdisk_disable_dev()
helpers in order to reduce code duplication.

This patch doesn't change any functionality.
2022-07-12 16:02:44 +03:00
Gleb Chesnokov
904bd8428b scst_vdisk: Unbreak the RHEL 9 build 2022-07-11 22:03:32 +03:00