Re: [PATCH] scsi_lib: replace ambiguous Unhandled error code messages.

2014-06-06 Thread Maurizio Lombardi
minutes. Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH V2] scsi_lib: removes ambiguous Unhandled error code messages.

2014-06-06 Thread Maurizio Lombardi
as it indicates something that is not addressed by the mid layer. This patch removes Unhandled error code and replaces Unhandled sense code with Failing command with sense code:. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/scsi_lib.c | 6 ++ 1 file changed, 2

[PATCH] pm8001: Fix potential null pointer dereference and memory leak.

2014-06-17 Thread Maurizio Lombardi
The pm8001_get_phy_settings_info() function does not check the kzalloc() return value and does not free the allocated memory. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/pm8001/pm8001_init.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff

[PATCH] bnx2fc: do not scan uninitialized lists in case of error.

2014-06-19 Thread Maurizio Lombardi
before calling bnx2fc_cmd_mgr_free(). Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 32a5e0a..7bc47fc 100644 --- a/drivers/scsi

Possible use after free in scsi_put_command()?

2014-06-24 Thread Maurizio Lombardi
, cmd); } cancel_delayed_work() may return while the abort handler is still running, the problem is that __scsi_put_command() frees the cmd pointer that is still used by the abort handler. Is it correct? Isn't safer to use cancel_delayed_work_sync() here? Thanks, Maurizio Lombardi -- To unsubscribe

Re: Possible use after free in scsi_put_command()?

2014-06-25 Thread Maurizio Lombardi
? No, I missed it, thanks for pointing it out to me. Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-25 Thread Maurizio Lombardi
-custom[2].value = conn-eh_abort_cnt; stats-digest_err = 0; Eddie, The code modifies the content of stats-custom[2], so shouldn't custom_length be set to 3? Why is it set to zero at the end of this function? Regards, Maurizio Lombardi -- To unsubscribe from this list: send the line

Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once

2014-06-25 Thread Maurizio Lombardi
This one looks good to me, Reviewed-by: Maurizio Lombardi mlomb...@redhat.com On 06/25/2014 04:01 PM, Rickard Strandqvist wrote: A struct member variable is set to different values without having used in between. This was found using a static code analysis program called cppcheck Signed

Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once

2014-06-25 Thread Maurizio Lombardi
ACK and it takes precedence in any case, am I wrong? Regards, Maurizio Lombardi thanks, Purush On Wed, Jun 25, 2014 at 8:34 AM, Maurizio Lombardi mlomb...@redhat.com wrote: This one looks good to me, Reviewed-by: Maurizio Lombardi mlomb...@redhat.com On 06/25/2014 04:01 PM

Re: [PATCH] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-26 Thread Maurizio Lombardi
the function behaviour) but helped to spot a defect. But I'll make a new patch then, with = 3 ? Yes, please submit a new patch which sets custom_length = 3 at the end of the function. Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi

Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up variable is set more than once

2014-06-26 Thread Maurizio Lombardi
On 06/26/2014 10:09 AM, Jack Wang wrote: Thanks Rickard, From my point of view, looks good, but I'd like to get review from Anand (cc-ed). I would like to add that I noticed that this fields is only set and appears to be never used, maybe it could be completely removed. Regards, Maurizio

[PATCH] beiscsi: the custom_length field has been set to a wrong value.

2014-06-26 Thread Maurizio Lombardi
In the beiscsi_conn_get_stats() function, custom_length should be set to 1 to take into account the eh_abort_cnt field at custom[0]. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/be2iscsi/be_iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v2] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-26 Thread Maurizio Lombardi
On 06/26/2014 02:05 PM, Joe Perches wrote: On Thu, 2014-06-26 at 13:54 +0200, Rickard Strandqvist wrote: A struct member variable is set to different values without having used in between. [] diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c [] @@

Re: [PATCH v2] scsi: bnx2i: bnx2i_iscsi.c: Cleaning up variable is set more than once

2014-06-26 Thread Maurizio Lombardi
On 06/26/2014 01:54 PM, Rickard Strandqvist wrote: A struct member variable is set to different values without having used in between. It is almost ok for me but I think you should mention that it also fixes a bug, or the commit message will be misleading. This was found using a static

[PATCH] b2iscsi: Fix memory leak in mgmt_set_ip()

2014-06-27 Thread Maurizio Lombardi
The if_info pointer is not released by the mgmt_set_ip() function Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/be2iscsi/be_mgmt.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi

Re: [PATCH] b2iscsi: Fix memory leak in mgmt_set_ip()

2014-06-27 Thread Maurizio Lombardi
; if (boot_proto == ISCSI_BOOTPROTO_DHCP) { if (if_info-dhcp_state) { beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, BG_%d : DHCP Already Enabled\n); goto exit; } Regards, Maurizio

Re: [PATCHv3 1/8] target: Add locking to some accesses to nacl.device_list

2014-07-01 Thread Maurizio Lombardi
the return 0; ? Regards, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Some question about usb scsi storage driver

2014-07-04 Thread Maurizio Lombardi
in sd_probe? is there any benefit to do so? A possible explanation may be that sd_probe_async() calls sd_spinup_disk(), this function spins up the drive and may block for some seconds, so it is better to do that asynchronously. Regards, Maurizio Lombardi -- To unsubscribe from this list: send

Re: [PATCH V2] scsi_lib: removes ambiguous Unhandled error code messages.

2014-07-08 Thread Maurizio Lombardi
tempted to agree and just remove the description. Do you want to send a patch for this? So I'll get rid of the description string completely... I'm going to send a new patch later today. Regards, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body

Re: [PATCH 4/8][RESEND] pm8001: Fix potential null pointer dereference and memory leak.

2014-07-09 Thread Maurizio Lombardi
Lombardi Signed-off-by: Maurizio Lombardi mlomb...@redhat.com Acked-by: Jack Wang xjtu...@gmail.com Acked-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com --- drivers/scsi/pm8001/pm8001_init.c | 13 ++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH V3] scsi_lib: remove the description string in scsi_io_completion()

2014-07-10 Thread Maurizio Lombardi
because it does not add useful information. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/scsi_lib.c | 40 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f7e3163

[PATCH] bnx2fc: do not add shared skbs to the fcoe_rx_list

2014-07-25 Thread Maurizio Lombardi
]--- Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 785d0d7..a190ab6 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b

Re: [PATCH] bnx2fc: do not add shared skbs to the fcoe_rx_list

2014-07-25 Thread Maurizio Lombardi
: Delivery has failed to these recipients or groups: dept_linux...@qlogic.commailto:dept_linux...@qlogic.com Your message can't be delivered because delivery to this address is restricted. On 07/25/2014 10:02 AM, Maurizio Lombardi wrote: In some cases, the fcoe_rx_list may contains

[PATCH] qla4xxx: check the return value of dma_alloc_coherent()

2014-07-28 Thread Maurizio Lombardi
the qla4xxx_alloc_fw_dump() calls dma_alloc_coherent() but does not check its return value. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/qla4xxx/ql4_init.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx

[PATCH] bnx2fc: fix incorrect DMA memory mapping in bnx2fc_map_sg()

2014-08-04 Thread Maurizio Lombardi
] ? kthread_create_on_node+0x170/0x170 [56069.689416] [816ca3bc] ret_from_fork+0x7c/0xb0 [56069.715510] [810a42c0] ? kthread_create_on_node+0x170/0x170 Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_io.c | 6 ++ 1 file changed, 2 insertions(+), 4

Re: [PATCH] bnx2fc: fix incorrect DMA memory mapping in bnx2fc_map_sg()

2014-08-22 Thread Maurizio Lombardi
Hi Eddie, On 08/20/2014 07:35 PM, Eddie Wai wrote: On Mon, 2014-08-04 at 10:20 +0200, Maurizio Lombardi wrote: In the bnx2fc_map_sg() function, the original behaviour is to allocate the DMA memory by directly calling dma_map_sg() instead of using scsi_dma_map(). In contrast

Re: [PATCH] bnx2fc: fix incorrect DMA memory mapping in bnx2fc_map_sg()

2014-08-22 Thread Maurizio Lombardi
it. So far, I didn't get any error or strange behaviour after this change. Eddie, what do you think about it? Regards, Maurizio Lombardi diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c index 32a5e0a..8b4adcf 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_io.c +++ b

[PATCH RESEND] bnx2fc: do not add shared skbs to the fcoe_rx_list

2014-08-27 Thread Maurizio Lombardi
]--- Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 79e5c94..72533c5 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b

Re: [PATCH] bnx2i: Make boot_nic entry visible in the sysfs session objects

2014-09-08 Thread Maurizio Lombardi
S_IRUGO; default: return 0; Can you merge this patch? It has been ACKed already. Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info

[PATCH RESEND] bnx2fc: fix tgt spinlock locking

2014-11-07 Thread Maurizio Lombardi
8820b0da3b68 CR2: 004c Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_els.c | 2 -- drivers/scsi/bnx2fc/bnx2fc_io.c | 19 ++- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi

Re: [PATCH] bnx2fc: do not add shared skbs to the fcoe_rx_list

2014-11-14 Thread Maurizio Lombardi
Hi Chad, On Fri, 2014-08-22 at 16:02 -0700, Eddie Wai wrote: On Fri, 2014-07-25 at 10:12 +0200, Maurizio Lombardi wrote: On 07/25/2014 10:02 AM, Maurizio Lombardi wrote: In some cases, the fcoe_rx_list may contains multiple instances of the same skb (the so called shared skbs

Re: [PATCH] bnx2fc: do not add shared skbs to the fcoe_rx_list

2014-11-18 Thread Maurizio Lombardi
Hi Chad, Thanks. CC James and Christoph On Fri, 2014-11-14 at 16:26 -0500, Chad Dupuis wrote: Maurizio, we've been running this for a little while with no issues so it's good to go from our perspective. Acked-by: Chad Dupuis chad.dup...@qlogic.com On Fri, 14 Nov 2014, Maurizio Lombardi

[PATCH RESEND] bnx2fc: do not add shared skbs to the fcoe_rx_list

2014-11-20 Thread Maurizio Lombardi
]--- Signed-off-by: Maurizio Lombardi mlomb...@redhat.com Acked-by: Chad Dupuis chad.dup...@qlogic.com --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 79e5c94..72533c5 100644

Re: [PATCH 06/16] scsi_dh_alua: use local buffer for VPD inquiry

2014-02-13 Thread Maurizio Lombardi
; + if (len bufflen) { [...] + bufflen = len; just a nit: is it safe to use char as the type of bufflen? Isn't better to declare it as int just in case len is than 255 ? Regards, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body

[PATCH] st: use dev_printk() to avoid linebreaks in kernel messages.

2014-02-19 Thread Maurizio Lombardi
This patch converts the st driver to use dev_printk() instead of printk(), every st device has a reference to the underlying scsi device. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/st.c | 613 +++--- 1 file changed, 349

Re: [PATCH] st: use dev_printk() to avoid linebreaks in kernel messages.

2014-02-19 Thread Maurizio Lombardi
and up-to-date patchset in your queue it would be interesting to have a look at it. Regards, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] bnx2fc: remove unused variable hash_table_size

2014-03-05 Thread Maurizio Lombardi
hash_table_size is not used by the bnx2fc_free_hash_table() function. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 46a3765

[PATCH 2/2] bnx2fc: fix memory leak and potential NULL pointer dereference.

2014-03-07 Thread Maurizio Lombardi
-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 261af2a..f83bae4 100644 --- a/drivers/scsi

[PATCH 0/2] bnx2fc: fix memory leak and potential NULL pointer dereferences

2014-03-07 Thread Maurizio Lombardi
dereferences that may happen if bnx2fc_allocate_hash_table() fails. Maurizio Lombardi (2): bnx2fc: remove unused variable hash_table_size bnx2fc: fix memory leak and potential NULL pointer dereference. drivers/scsi/bnx2fc/bnx2fc_hwi.c | 36 ++-- 1 file changed, 18

[PATCH 1/2] bnx2fc: remove unused variable hash_table_size

2014-03-07 Thread Maurizio Lombardi
hash_table_size is not used by the bnx2fc_free_hash_table() function. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 46a3765

Re: [PATCH 2/2] bnx2fc: fix memory leak and potential NULL pointer dereference.

2014-03-07 Thread Maurizio Lombardi
). It just requires a very little change to your patch, I'll send it tomorrow. Regards, Maurizio Lombardi Thanks, Eddie @@ -2020,7 +2026,7 @@ static int bnx2fc_allocate_hash_table(struct bnx2fc_hba *hba) dma_segment_array = kzalloc(dma_segment_array_size, GFP_KERNEL

[PATCH v2 0/3] bnx2fc: fix memory leaks and NULL pointer dereferences

2014-03-10 Thread Maurizio Lombardi
in the bnx2fc_free_hash_table() function that may happen if bnx2fc_allocate_hash_table() fails. PATCH 3/3 fixes a memory leak in the bnx2fc_allocate_hash_table() function. Maurizio Lombardi (3): bnx2fc: remove unused variable hash_table_size bnx2fc: fix memory leak and potential NULL pointer

[PATCH 3/3] bnx2fc: fix memory leak in bnx2fc_allocate_hash_table()

2014-03-10 Thread Maurizio Lombardi
In case of error, the bnx2fc_allocate_hash_table() didn't free all the memory it allocated. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/scsi

[PATCH 1/3] bnx2fc: remove unused variable hash_table_size

2014-03-10 Thread Maurizio Lombardi
hash_table_size is not used by the bnx2fc_free_hash_table() function. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 46a3765

[PATCH 2/3] bnx2fc: fix memory leak and potential NULL pointer dereference.

2014-03-10 Thread Maurizio Lombardi
-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 261af2a..f83bae4 100644 --- a/drivers/scsi

[PATCH] scsi: fix potential NULL pointer dereference.

2014-03-25 Thread Maurizio Lombardi
The scsi_get_command() function returns NULL if it fails to allocate the scsi_cmnd structure. If this happens, a NULL pointer will be dereferenced. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/scsi_error.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers

Re: [PATCH] scsi: fix potential NULL pointer dereference.

2014-03-25 Thread Maurizio Lombardi
On Tue, Mar 25, 2014 at 06:13:06AM -0700, Christoph Hellwig wrote: diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 78b004d..4021849 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2289,6 +2289,9 @@ scsi_reset_provider(struct scsi_device

[PATCH 3/3] bnx2fc: fix memory leak in bnx2fc_allocate_hash_table()

2014-04-01 Thread Maurizio Lombardi
In case of error, the bnx2fc_allocate_hash_table() didn't free all the memory it allocated. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/scsi

[PATCH 1/3] bnx2fc: remove unused variable hash_table_size

2014-04-01 Thread Maurizio Lombardi
hash_table_size is not used by the bnx2fc_free_hash_table() function. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 46a3765

[PATCH 2/3] bnx2fc: fix memory leak and potential NULL pointer dereference.

2014-04-01 Thread Maurizio Lombardi
-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 261af2a..f83bae4 100644 --- a/drivers/scsi

[PATCH v3 0/3] bnx2fc: fix memory leaks and NULL pointer dereferences

2014-04-01 Thread Maurizio Lombardi
in the bnx2fc_allocate_hash_table() function. Maurizio Lombardi (3): bnx2fc: remove unused variable hash_table_size bnx2fc: fix memory leak and potential NULL pointer dereference. bnx2fc: fix memory leak in bnx2fc_allocate_hash_table() drivers/scsi/bnx2fc/bnx2fc_hwi.c | 64

[PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-04-22 Thread Maurizio Lombardi
Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/device_handler/scsi_dh_alua.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 5248c88

Re: [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-04-25 Thread Maurizio Lombardi
to that. Yes I think you are right, I'm trying to write a patch to get rid of all this duplicated code. I'll publish a patchset next week. Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-04-29 Thread Maurizio Lombardi
in case blk_execute_rq() returns an error. Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-04-29 Thread Maurizio Lombardi
can be easily reproduced with the st driver: 1) set CONFIG_SCSI_MPT2SAS_MAX_SGE or CONFIG_SCSI_MPT3SAS_MAX_SGE to 16 2) modprobe st buffer_kbs=1024 3) #dd if=/dev/zero of=/dev/st0 bs=1M count=10 dd: error writing ‘/dev/st0’: Device or resource busy Signed-off-by: Maurizio Lombardi mlomb

[PATCH V2] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-04-29 Thread Maurizio Lombardi
can be easily reproduced with the st driver: 1) set CONFIG_SCSI_MPT2SAS_MAX_SGE or CONFIG_SCSI_MPT3SAS_MAX_SGE to 16 2) modprobe st buffer_kbs=1024 3) #dd if=/dev/zero of=/dev/st0 bs=1M count=10 dd: error writing ‘/dev/st0’: Device or resource busy Signed-off-by: Maurizio Lombardi mlomb

Re: [PATCH] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-04-29 Thread Maurizio Lombardi
Sorry I did a mistake in this patch: on failure I should restore the original value of bi_phys_segments. I'm going to send a new version. Maurizio Lombardi On Tue, Apr 29, 2014 at 04:58:18PM +0200, Maurizio Lombardi wrote: The original behaviour is to refuse to add a new page if the maximum

[PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-01 Thread Maurizio Lombardi
the previous number of segments but left the BIO_SEG_FLAG set. To avoid problems, after the page is removed from the bio vec, V3 performs a recount of the segments in the error code path. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- fs/bio.c | 48

Re: [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-05-13 Thread Maurizio Lombardi
version of the patch (http://www.spinics.net/lists/linux-scsi/msg73984.html)? We could proceed to rewrite the functions later. Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] scsi: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-05-13 Thread Maurizio Lombardi
not make use of scsi_execute(): http://www.spinics.net/lists/linux-scsi/msg73984.html Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] scsi_lib: replace ambiguous Unhandled error code messages.

2014-05-26 Thread Maurizio Lombardi
as it indicates something that is not addressed by the mid layer. This patch replaces Unhandled error code with Extended error description not available. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/scsi_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

Re: [PATCH] scsi_lib: replace ambiguous Unhandled error code messages.

2014-05-26 Thread Maurizio Lombardi
Hi, On Mon, May 26, 2014 at 09:25:06AM -0700, Christoph Hellwig wrote: On Mon, May 26, 2014 at 12:13:24PM +0200, Maurizio Lombardi wrote: During IO with fabric faults, one generally sees several Unhandled error code messages in the syslog as shown below: sd 4:0:6:2: [sdbw] Unhandled

Re: [PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-27 Thread Maurizio Lombardi
) There was already a patchset trying to modify the code in a different way than mine: https://groups.google.com/forum/#!msg/linux.kernel/3IanUpBVhFQ/3Xbg3yLRFp4J but it has been ignored and in my opinion it takes a more complicated approach. Regards, Maurizio Lombardi -- To unsubscribe from this list: send

Re: [PATCH V3] bio: modify __bio_add_page() to accept pages that don't start a new segment

2014-05-27 Thread Maurizio Lombardi
(). But it shouldn't have been related with current virtio-blk problem. This is a valid point, bi_iter.bi_size influences the behaviour of blk_recount_segments(). Maybe Jens can confirm your observation. Anyway it doesn't explain the reason behind the regression introduced by commit 3979ef4dcf Maurizio

Re: [PATCH] be2iscsi: Use pci_zalloc_consistent() where possible and get rid of memset(,0,)

2015-03-09 Thread Maurizio Lombardi
I forgot the signed-off-by, I'll send a new version. On Fri, 2015-03-06 at 14:52 +0100, Maurizio Lombardi wrote: --- drivers/scsi/be2iscsi/be_iscsi.c | 3 +-- drivers/scsi/be2iscsi/be_main.c | 3 +-- drivers/scsi/be2iscsi/be_mgmt.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions

[PATCH] be2iscsi: Use pci_zalloc_consistent() where possible and get rid of memset(,0,)

2015-03-06 Thread Maurizio Lombardi
, sizeof(*req)); spin_lock(ctrl-mbox_lock); memset(wrb, 0, sizeof(*wrb)); be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1); -- Maurizio Lombardi -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More

[PATCH V3] fnic: check pci_map_single() return value

2015-08-12 Thread Maurizio Lombardi
check_unmap+0x47b/0x920() [ 11.950821] fnic :0c:00.0: DMA-API: device driver failed to check map error[device address=0x002020a30040] [size=44 bytes] [mapped as single] Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/fnic/fnic_fcs.c | 46

Re: [PATCH V2] fnic: check pci_map_single() return value

2015-08-12 Thread Maurizio Lombardi
, Maurizio Lombardi Maurizio Lombardi mlomb...@redhat.com writes: the kernel prints some warnings when compiled with CONFIG_DMA_API_DEBUG. This is because the fnic driver doesn't check the return value of pci_map_single(). [ 11.942770] scsi host12: fnic } [..] void fnic_free_rq_buf

[PATCH V2] fnic: check pci_map_single() return value

2015-08-12 Thread Maurizio Lombardi
check_unmap+0x47b/0x920() [ 11.950821] fnic :0c:00.0: DMA-API: device driver failed to check map error[device address=0x002020a30040] [size=44 bytes] [mapped as single] Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/fnic/fnic_fcs.c | 32

Re: [PATCH] st: trivial: remove form feed characters

2015-11-06 Thread Maurizio Lombardi
particular - those characters make the code look weird. It's not a real issue so if you want to keep them it's ok for me. Regards, Maurizio Lombardi -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo in

[PATCH] st: trivial: remove form feed characters

2015-11-04 Thread Maurizio Lombardi
Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/st.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index b37b9b0..7c4e518 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@

Re: [PATCH] bnx2fc: reduce stack usage in __bnx2fc_enable

2015-10-07 Thread Maurizio Lombardi
> If kzalloc() fails perhaps the function should return -ENOMEM, not zero. Regards, Maurizio Lombardi -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] st: fix potential null pointer dereference.

2015-11-18 Thread Maurizio Lombardi
Please ignore this one, I sent a V2 On 11/18/2015 02:18 PM, Maurizio Lombardi wrote: > If cdev_add() returns an error, the code calls > cdev_del() passing the STm->cdevs[rew] pointer as parameter; > the problem is that the pointer has not been initialized yet. > > This patch

bnx2fc patch merge request

2015-09-30 Thread Maurizio Lombardi
Hi James, the following patch for bnx2fc has been acked by QLogic but has never been included into the scsi branch. Can you please merge it? http://marc.info/?l=linux-scsi=140207797017410=2 Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line "unsubscribe linux

[PATCH] be2iscsi: Fix memory leak in beiscsi_alloc_mem()

2015-10-01 Thread Maurizio Lombardi
In case of error, the memory allocated for phwi_ctrlr was not freed. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/be2iscsi/be_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_

Re: [RFC PATCH 0/3] fix *pbl format support

2015-09-21 Thread Maurizio Lombardi
i_debug/map 0-15 # lvcreate -V200m -l99%FREE -T tsvg/pool -n lv1 --discards ignore Logical volume "lv1" created. # cat /sys/bus/pseudo/drivers/scsi_debug/map 0-31,2048-2055,501760-501871 Thanks, Maurizio Lombardi > > add/remove: 18/16 grow/shrink: 3/2 up/down: 5551/-5775

Re: [PATCH V3] fnic: check pci_map_single() return value

2015-09-21 Thread Maurizio Lombardi
ping? On 08/12/2015 05:00 PM, Maurizio Lombardi wrote: > the kernel prints some warnings when compiled with CONFIG_DMA_API_DEBUG. > This is because the fnic driver doesn't check the return value of > pci_map_single(). > > [ 11.942770] scsi host12: fnic > [ 11.950811]

[PATCH] st: fix potential null pointer dereference.

2015-11-18 Thread Maurizio Lombardi
o sets STm->devs[rew] = NULL if device_create() fails, just to be sure we won't end up calling device_unregister() with an invalid pointer. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/driv

[PATCH] bnx2fc: replace printk() with BNX2FC_IO_DBG()

2016-05-30 Thread Maurizio Lombardi
The "fcp_rsp_code = %d" message isn't an error, it's meant to be informative only. This patch prevents a flood of such messages in some situations. Tested-by: Laurence Oberman <lober...@redhat.com> Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/

[PATCH] bnx2fc: bnx2fc_eh_abort(): fix wrong return code.

2016-02-01 Thread Maurizio Lombardi
If the link is not ready, the bnx2fc_eh_abort() function should return FAILED. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/bnx2fc/bnx2fc_io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/

[PATCH] megaraid: fix null pointer check in megasas_detach_one().

2016-01-22 Thread Maurizio Lombardi
The pd_seq_sync pointer can't be NULL, we have to check its entries instead. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/megaraid/megaraid_sas_base.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/me

Re: [PATCH] be2iscsi: set the boot_kset pointer to NULL in case of failure

2016-03-08 Thread Maurizio Lombardi
On 03/08/2016 03:03 AM, Martin K. Petersen wrote: >>>>>> "Maurizio" == Maurizio Lombardi <mlomb...@redhat.com> writes: > > Maurizio, > > Maurizio> In beiscsi_setup_boot_info(), the boot_kset pointer should be > Maurizio> set to NULL in

[PATCH] be2iscsi: set the boot_kset pointer to NULL in case of failure

2016-03-04 Thread Maurizio Lombardi
In beiscsi_setup_boot_info(), the boot_kset pointer should be set to NULL in case of failure otherwise an invalid pointer dereference may occur later. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/be2iscsi/be_main.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH RFC] enclosure: fix symlinks creation

2017-02-07 Thread Maurizio Lombardi
immediately without retrying to create the symlinks. Maurizio Lombardi (1): enclosure: fix sysfs symlinks creation when using multipath drivers/misc/enclosure.c | 16 ++-- include/linux/enclosure.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) -- Maurizio Lombardi

[PATCH RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-02-07 Thread Maurizio Lombardi
the subsequent calls to enclosure_add_device() will immediately fail with EEXIST. This patch modifies the code so the driver will detect this condition and will retry to create the symlinks when enclosure_add_device() is called. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- driver

Re: [PATCH RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-02-16 Thread Maurizio Lombardi
Hi James, have you noticed this patch? Dne 7.2.2017 v 15:08 Maurizio Lombardi napsal(a): > With multipath, it may happen that the same device is passed > to enclosure_add_device() multiple times and that the enclosure_add_links() > function fails to create the symlinks because the

[PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-02 Thread Maurizio Lombardi
] enclosure_add_device(0:0:27:0) called, device already exists This patch modifies the code so the driver will detect this condition and will retry to create the symlinks when enclosure_add_device() is called. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/misc/enclosure.c

Re: [PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-28 Thread Maurizio Lombardi
Dne 21.3.2017 v 10:58 Maurizio Lombardi napsal(a): > I will ask our customer to test your patch, > there is only a small problem: you can't set cdev->dev = NULL > and then call enclosure_add_links(cdev) because you will end up dereferencing > a NULL pointer. > I suggest a

Re: [PATCH] enclosure: fix sysfs symlinks creation when using multipath

2017-03-21 Thread Maurizio Lombardi
Dne 16.3.2017 v 19:49 James Bottomley napsal(a): > diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c > index 65fed71..ae89082 100644 > --- a/drivers/misc/enclosure.c > +++ b/drivers/misc/enclosure.c > @@ -375,6 +375,7 @@ int enclosure_add_device(struct enclosure_device *edev, >

[PATCH] scsi: lpfc: fix potential buffer overflow.

2017-04-18 Thread Maurizio Lombardi
This patch fixes a potential buffer overflow in lpfc_nvme_info_show(). Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/lpfc/lpfc_attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_

Re: [PATCH] ses: do not add a device to an enclosure if enclosure_add_links() fails.

2017-07-10 Thread Maurizio Lombardi
Douglas, > Has there been any progress with getting this patch accepted? > It has been merged already. It's in linux-next, commit 62e62ffd95539b9220894a7900a619e0f3ef4756 https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next/+/62e62ffd95539b9220894a7900a619e0f3ef4756

[PATCH] lpfc: fix "integer constant too large" error on 32bit archs

2017-07-27 Thread Maurizio Lombardi
cc1: warnings being treated as errors drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_get_wwpn': drivers/scsi/lpfc/lpfc_init.c:3253: error: integer constant is too large for 'long' type Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/lpfc/lpfc_init.c | 4 ++--

Re: [PATCH] lpfc: fix "integer constant too large" error on 32bit archs

2017-07-27 Thread Maurizio Lombardi
Dne 27.7.2017 v 14:57 Martin K. Petersen napsal(a): >> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c >> index 491aa95..e992dc1 100644 >> --- a/drivers/scsi/lpfc/lpfc_init.c >> +++ b/drivers/scsi/lpfc/lpfc_init.c >> @@ -3710,8 +3710,8 @@ >> if (phba->sli_rev ==

[PATCH V2] scsi: lpfc: fix "integer constant too large" error on 32bit archs

2017-07-27 Thread Maurizio Lombardi
cc1: warnings being treated as errors drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_get_wwpn': drivers/scsi/lpfc/lpfc_init.c:3253: error: integer constant is too large for 'long' type Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> v2: use rol64() --- drivers/scsi/lpfc/lpfc_

[PATCH] ses: fix error message in ses_intf_add()

2017-05-17 Thread Maurizio Lombardi
Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/ses.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index f1cdf32..0ac45be 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -604,6

Re: enclosure: fix sysfs symlinks creation when using multipath

2017-06-20 Thread Maurizio Lombardi
Dne 16.6.2017 v 18:08 Douglas Miller napsal(a): > Just to respond to James' question on the cause. What I observed was a race > condition between udevd (ses_init()) and a worker thread (do_scan_async()), > where the worker thread is creating the directories that are the target of > the

[PATCH] ses: do not add a device to an enclosure if enclosure_add_links() fails.

2017-06-27 Thread Maurizio Lombardi
The enclosure_add_device() function should fail if it can't create the relevant sysfs links. Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/misc/enclosure.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/misc/enclosure.c b/d

[PATCH] bnx2fc: fix race condition in bnx2fc_get_host_stats()

2017-05-24 Thread Maurizio Lombardi
x20 [scsi_transport_fc] [] ? dev_attr_show+0x27/0x50 [] ? __get_free_pages+0xe/0x50 [] ? sysfs_read_file+0x111/0x200 [] ? vfs_read+0xb5/0x1a0 [] ? fget_light_pos+0x16/0x50 [] ? sys_read+0x51/0xb0 [] ? __audit_syscall_exit+0x25e/0x290 [] ? system_call_fastpath+0x16/0x1b Signed-off-by: Maurizio Lombardi <

Re: [RFC] enclosure: fix sysfs symlinks creation when using multipath

2017-06-16 Thread Maurizio Lombardi
Dne 16.6.2017 v 14:40 Douglas Miller napsal(a): > > I'd like to add that we are seeing this problem with singlepath installations > and need to get this fixed upstream as soon as possible. RHEL new product > contains this fix and is working for us, but we need to be able to offer > other

[PATCH] sr: mark device as changed when performing a write SG_IO operation

2018-05-22 Thread Maurizio Lombardi
Signed-off-by: Maurizio Lombardi <mlomb...@redhat.com> --- drivers/scsi/sr.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 3f3cb72..e64311d 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -49,6 +49,7 @@ #include #i

  1   2   >