Instead of calling qla2x00_fcport_event_handler() and letting the
switch statement inside that function decide which other function
to call, call the latter function directly. Remove the event member
from the event_arg structure because it is no longer needed. Remove
the qla_handle_els_plogi_done()
This patch reduces code duplication.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_def.h | 2 +-
drivers/scsi/qla2xxx/qla_gbl.h | 2 ++
drivers/scsi/qla2xxx/qla_gs.c | 12 +-
drivers/scsi/qla2xxx/qla_iocb.c | 40 ++---
BUG: KASAN: null-ptr-deref in qla24xx_handle_plogi_done_event+0x134/0x9f0
[qla2xxx]
Read of size 4 at addr 00a0 by task swapper/2/0
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 5.2.0-dbg+ #1
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
dump_stack+0x8a/0xd6
__kasan_re
This patch fixes the following Coverity complaint:
Null-checking sp->u.iocb_cmd.u.ctarg.rsp suggests that it may be null, but
it has already been dereferenced on all paths leading to the check.
See also commit e374f9f59281 ("scsi: qla2xxx: Migrate switch registration
commands away from mailbox i
Make the code easier to read by converting 'goto' statements into
'return' statements.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_init.c | 14 ++
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/dri
It is easy to mix up the QLA_* and the MBS_* status codes. Complain loudly
if that happens.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_def.h | 5 +
drivers/scsi/qla2xxx/qla_init.c | 9 +
2 files changed, 14 insertions(+)
diff --git a/drivers/s
Make it clear to humans and also to the compiler that the string passed
as fourth argument is not modified.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_gbl.h | 4 ++--
drivers/scsi/qla2xxx/qla_init.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
Split srb_cmd.ctx into two pointers such that the compiler can check
the type of that pointer.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_def.h | 4 ++--
drivers/scsi/qla2xxx/qla_iocb.c | 20 +---
drivers/scsi/qla2xxx/qla_nx.c | 2 +-
d
This patch reduces code duplication.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_gbl.h | 1 +
drivers/scsi/qla2xxx/qla_iocb.c | 128 +---
drivers/scsi/qla2xxx/qla_mr.c | 13 +---
drivers/scsi/qla2xxx/qla_nvme.c | 14 +---
4
This patch fixes several gcc complaints about string truncation.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_mr.c | 28 ++--
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/
This patch does not change any functionality.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_gs.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 5ec3c2b96f3f..33e0c
This change makes it easier to detect qla24xx_read_flash_data() failures
and also to handle such failures. This change does not modify the behavior
of the driver since all callers ignore the qla24xx_read_flash_data()
return value.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/
Since struct sg_table is used in nvme-fc-driver.h, include
from that header file.
Since no definitions or declarations from are used in
the qla_nvme.h header file, do not include from that
header file.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_nvme.h |
This patch does not change any functionality but makes the next patch
easier to read.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_inline.h | 28 +++-
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/scsi/qla2xxx
This was detected by Coverity.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_os.c | 17 -
1 file changed, 17 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 37e24987c852..2ba06a84c501 100644
--- a/
Introduce the be_id_t and le_id_t data types for Fibre Channel source and
destination ID formats supported by the firmware instead of using an
uint8_t[3] array. Introduce functions for converting from and to the
port_id_t data types. This patch does not change the behavior of the
qla2xxx driver but
This patch fixes several Coverity complaints about not always checking
the qla2x00_wait_for_hba_online() return value.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_attr.c | 3 ++-
drivers/scsi/qla2xxx/qla_target.c | 7 +--
2 files changed, 7 insertions(
Pass the output buffer size to the code that generates a PCI info string
and check the output buffer size while generating a PCI info string.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_attr.c | 3 +-
drivers/scsi/qla2xxx/qla_def.h | 2 +-
drivers/scsi/ql
Read the FC port state once instead of twice. This patch fixes the
following Coverity complaint:
Unchecked return value (CHECKED_RETURN)
check_return: Calling atomic_read without checking return value (as is
done elsewhere 80 out of 92 times).
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
Set the r??_data_len variables before using these instead of after.
This patch fixes the following Coverity complaint:
const: At condition req_data_len != rsp_data_len, the value of req_data_len
must be equal to 0.
const: At condition req_data_len != rsp_data_len, the value of rsp_data_len
must b
Not calling sp->done() from the command completion path is a severe bug.
Hence complain loudly if that happens.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_init.c | 4
drivers/scsi/qla2xxx/qla_isr.c | 4
drivers/scsi/qla2xxx/qla_mr.c | 4
3
This patch fixes the following Coverity complaint:
Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression dma_eng_num *
65536U with type unsigned int (32 bits, unsigned) is evaluated using 32-bit
arithmetic, and then used in a context that
The LIO core requires that the target driver callback functions
.queue_data_in() and .queue_status() call target_put_sess_cmd() or
transport_generic_free_cmd(). These calls may happen synchronously or
asynchronously. Make sure that one of these LIO functions is called
in case a command has been abo
This patch fixes several Coverity complaints about reading data that
has not been initialized.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_init.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/dr
The C language supports implicit casting of void pointers to non-void
pointers. Remove explicit sts_entry_* casts that are not necessary.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_isr.c | 15 +--
1 file changed, 5 insertions(+), 10 deletions(-)
According to the firmware documentation the firmware expects all ELS
pass-through IOCB parameters in little endian format. Make this explicit.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_fw.h | 8
drivers/scsi/qla2xxx/qla_iocb.c | 7 ---
2 fil
Instead of allocating a struct srb dynamically from inside .queuecommand(),
set qla2xxx_driver_template.cmd_size such that struct scsi_cmnd and struct
srb are contiguous. Do not call QLA_QPAIR_MARK_BUSY() /
QLA_QPAIR_MARK_NOT_BUSY() for SRBs associated with SCSI commands. That is
safe because scsi_
Make sure that locking assumptions are verified at runtime if kernel
debugging is enabled.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.c | 8
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_target.c
b/drivers/scsi/qla2
Failure of a soft reset is a severe failure. Hence report such failures.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_tmpl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
It is helpful when debugging this driver to have the firmware status
code available if a mailbox command fails. Hence report that firmware
status code.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_mbx.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(
Avoid that this function crashes if mcmd == NULL.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.c
b/drivers/scsi/qla2xxx/qla_target.c
index d25c3fa436
This patch makes it clear to humans and also to the compiler that
ql_dump_buffer() does not modify the memory the @buf argument points at.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_dbg.c | 3 ++-
drivers/scsi/qla2xxx/qla_gbl.h | 2 +-
2 files changed, 3 in
According to the firmware documentation responder mode must be set for
ELS pass-through IOCBs if a response is expected.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_iocb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/qla
The value returned by this function is not used. Hence change the
return type of this function into 'void' and remove the return
statement.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_gs.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git
Pass the correct session ID to find_sess_by_s_id() instead of passing
an uninitialized variable.
Cc: Himanshu Madhani
Fixes: 2d70c103fd2a ("[SCSI] qla2xxx: Add LLD target-mode infrastructure for >=
24xx series") # v3.5.
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.c | 4 +
Since sess == NULL before 'goto out_term2' is executed, the code under
'if (sess)' cannot be reached. Hence remove that code. This was detected
by Coverity.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.c | 3 ---
1 file changed, 3 deletions(-)
diff --
Instead of explicitly checking whether a timeout has occurred, ignore
the del_timer() return value.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_init.c | 12 +---
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_i
Since qlt_make_local_sess() is defined before it is called, remove the
forward declaration of that function.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.c
b/driver
Since all pointers passed to the srb_t.done() and srb_t.free() functions
have type srb_t, change the type of the first argument of these functions
from void * into struct srb *. This allows the compiler to verify the
argument types for these functions. This patch does not change any
functionality.
This patch fixes a Coverity complaint about not checking the sscanf()
return value.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_tmpl.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla
Checking a pointer after it has been dereferenced is not useful. This was
detected by Coverity.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_nvme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/s
This patch fixes the following Coverity complaint:
Unchecked return value (CHECKED_RETURN)
check_return: Calling wait_for_completion_timeout without checking return
value (as is done elsewhere 14 out of 17 times).
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla
Use the same approach for encoding the destination ID as the approach
used by qlt_update_vp_map().
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.
Such a timeout is a severe issue. Hence complain if waiting for pending
commands times out. This patch fixes a small bug: it modifies
qla82xx_chip_reset_cleanup() such that the "Done waiting" message is
reported if qla82xx_chip_reset_cleanup() succeeded instead of if that
function failed.
Cc: Hima
This patch makes the string manipulation code easier to verify.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_init.c | 18 ++
drivers/scsi/qla2xxx/qla_mr.c | 6 --
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/drivers/
Simplify the implementation of this function by using the %phC format
specifier instead of using explicit for-loops.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.c | 18 +++---
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/
Delete the PLOGIN ACK data structure from the vha->plogi_ack_list before
freeing that data structure to avoid that that list gets corrupted.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_os.c | 8 ++--
drivers/scsi/qla2xxx/qla_target.c | 4 +++-
2 file
Make it clear that the CDB is not modified after processing of a SCSI
command has started.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_target.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.h
b/drivers/s
This patch makes the code that parses the GID list easier to read
without changing the behavior of the code.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_dfs.c| 9 +++--
drivers/scsi/qla2xxx/qla_init.c | 18 --
drivers/scsi/qla2xxx/
This patch does not change any functionality but fixes a Coverity
complaint about using a scalar as an array.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_def.h| 4 ++--
drivers/scsi/qla2xxx/qla_iocb.c | 4 ++--
drivers/scsi/qla2xxx/qla_target.c | 4 ++-
Since qlt_remove_target() only calls qlt_release() if
vha->vha_tgt.qla_tgt != NULL, checking that pointer inside qlt_release()
is not necessary. This patch fixes the following Coverity complaint:
CID 188348 (#1 of 1): Dereference after null check (FORWARD_NULL)
var_deref_model: Passing null pointe
This patch makes it clear that the tag, hwq and qpair variables are
only used in the mq path.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_os.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/
I'm not sure how this happened but the patch that was intended to fix
abort handling was incomplete. This patch fixes that patch as follows:
- If aborting the SCSI command failed, wait until the SCSI command
completes.
- Return SUCCESS instead of FAILED if an abort attempt races with SCSI
comma
Insert a space where required, surround complex expressions in macros
with parentheses, use the UL suffix instead of the (unsigned long) cast,
do not use line continuations when not necessary and do not explicitly
initialize static variables to zero.
Cc: Himanshu Madhani
Signed-off-by: Bart Van A
Since qla2x00_abort_srb() starts with increasing the reference count of
@sp, decrease that same reference count before returning.
Cc: Himanshu Madhani
Fixes: 219d27d7147e ("scsi: qla2xxx: Fix race conditions in the code for
aborting SCSI commands") # v5.2.
Signed-off-by: Bart Van Assche
---
dr
Hi Martin,
The patches in this series improve the robustness of the QLogic Fibre Channel
initiator and target drivers. These patches are a result of manual code
inspection, analysis of Coverity reports and stress testing of these two
drivers. Please consider these patches for kernel version v5.4.
This patch only modifies whitespace.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_gs.c | 78 +--
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
inde
Since the put_unaligned_*() macros are used in this header file, include
the header file that defines these macros.
Cc: Himanshu Madhani
Fixes: 15b7a68c1d03 ("scsi: qla2xxx: Introduce the dsd32 and dsd64 data
structures") # v5.2-rc1.
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_
There is no bsg code in the qla_mr.c source file. Hence do not include
the header file from qla_mr.c.
Cc: Himanshu Madhani
Signed-off-by: Bart Van Assche
---
drivers/scsi/qla2xxx/qla_mr.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/ql
Hi Steffen,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190808]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0day-ci/linux/commits/Steffen
On 08/08/2019 03:42 AM, Naohiro Aota wrote:
> On Tue, Aug 06, 2019 at 12:42:20PM -0500, Mike Christie wrote:
>> On 08/05/2019 09:45 PM, Naohiro Aota wrote:
>>> On Mon, Aug 05, 2019 at 11:33:26AM -0500, Mike Christie wrote:
On 08/05/2019 01:23 AM, Naohiro Aota wrote:
> targetcli-fb (or its
Martin,
The firmware provided queue depth provides optimum performance in most of
the cases/workloads. And this patch provides the option to the user to go
with max queue_depth or with optimum queue_depth.
-Chandrakanth
-Original Message-
From: Martin K. Petersen [mailto:martin.peter...@
Hi Bart,
> On Aug 1, 2019, at 12:55 PM, Bart Van Assche wrote:
>
> Hi Martin,
>
> The patches in this series improve the robustness of the QLogic Fibre Channel
> initiator and target drivers. These patches are a result of manual code
> inspection, analysis of Coverity reports and stress testi
On Tue, Aug 06, 2019 at 12:42:20PM -0500, Mike Christie wrote:
On 08/05/2019 09:45 PM, Naohiro Aota wrote:
On Mon, Aug 05, 2019 at 11:33:26AM -0500, Mike Christie wrote:
On 08/05/2019 01:23 AM, Naohiro Aota wrote:
targetcli-fb (or its library: rtslib-fb) allows us to create LUN up to
65535. On
64 matches
Mail list logo