[PATCH] fnic: check pci_map_single() return value

2015-08-12 Thread Maurizio Lombardi
c:937 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 --- drivers/scsi/fnic/fnic_fcs.c | 32 +--- drivers/scsi

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

2015-08-12 Thread Maurizio Lombardi
return r; >> } > > Although the return is near to the error handling, it's preferred to > have the labels named after the action that is taken there. Ok, I'll post a V2 of this patch soon, thanks for the review. Regards, Maurizio Lombardi -- To unsubscribe from th

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

2015-08-12 Thread Maurizio Lombardi
c:937 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 --- drivers/scsi/fnic/fnic_fcs.c | 32 ++-- drivers/scsi

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

2015-08-12 Thread Maurizio Lombardi
he review. Regards, Maurizio Lombardi > > Maurizio Lombardi 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(). >> >>

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

2015-08-12 Thread Maurizio Lombardi
c:937 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 --- drivers/scsi/fnic/fnic_fcs.c | 46 +++ dr

[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
l 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 --- drivers/misc/enclosure.c

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
92722] 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 --- drivers/misc/enclosure.c

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

2014-07-25 Thread Maurizio Lombardi
node+0x140/0x140 [ 6286.808772] [] ret_from_fork+0x7c/0xb0 [ 6286.808773] [] ? kthread_create_on_node+0x140/0x140 [ 6286.808774] ---[ end trace c6cdb939184ccb4e ]--- Signed-off-by: Maurizio Lombardi --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

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

2014-07-25 Thread Maurizio Lombardi
ation: Delivery has failed to these recipients or groups: dept_linux...@qlogic.com<mailto: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_r

[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 --- 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/ql4_init.c index

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

2014-08-04 Thread Maurizio Lombardi
069.604560] [] ? bnx2fc_get_src_mac+0x20/0x20 [bnx2fc] [56069.635801] [] kthread+0xd2/0xf0 [56069.659421] [] ? kthread_create_on_node+0x170/0x170 [56069.689416] [] ret_from_fork+0x7c/0xb0 [56069.715510] [] ? kthread_create_on_node+0x170/0x170 Signed-off-by: Maurizio Lombardi --- drivers/scsi/bnx2fc/bnx2f

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

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

2014-08-22 Thread Maurizio Lombardi
icious exception and I decided to change 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 32a

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

2014-08-25 Thread Maurizio Lombardi
Hi Eddie, On 08/23/2014 01:02 AM, Eddie Wai wrote: > is this still a problem? The mail reflector seems to work for me... > Works for me now. Regards, Maurizio Lombardi >> >> On 07/25/2014 10:02 AM, Maurizio Lombardi wrote: >>> In some cases, the fcoe_rx_list may

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

2014-08-27 Thread Maurizio Lombardi
node+0x140/0x140 [ 6286.808772] [] ret_from_fork+0x7c/0xb0 [ 6286.808773] [] ? kthread_create_on_node+0x140/0x140 [ 6286.808774] ---[ end trace c6cdb939184ccb4e ]--- Signed-off-by: Maurizio Lombardi --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

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

2014-09-08 Thread Maurizio Lombardi
> return 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 at http://vger.kernel.org/majordomo-info.html

[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 --- drivers/scsi/be2iscsi/be_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/be2iscsi

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 writes: > > Maurizio, > > Maurizio> In beiscsi_setup_boot_info(), the boot_kset pointer should be > Maurizio> set to NULL in case of failure otherwise an

[PATCH] fnic: move printk()s outside of the critical code section.

2016-03-19 Thread Maurizio Lombardi
9/0xd0 [709686.317307] [] do_readv_writev+0xce/0x260 [709686.317310] [] ? __sb_start_write+0x58/0x110 [709686.317314] [] vfs_writev+0x35/0x60 [709686.317318] [] SyS_writev+0x5c/0xd0 [709686.317322] [] system_call_fastpath+0x16/0x1b Signed-off-by: Maurizio Lombardi --- drivers/scsi/fnic/fnic_

[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 Signed-off-by: Maurizio Lombardi --- drivers/scsi/bnx2fc/bnx2fc_io.c | 2 +- 1 file change

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

2015-03-06 Thread Maurizio Lombardi
controller_attributes); req = nonemb_cmd.va; - memset(req, 0, 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 &

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 fil

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

2015-03-09 Thread Maurizio Lombardi
Signed-off-by: Maurizio Lombardi --- 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(-) diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c

[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 --- drivers/scsi/megaraid/megaraid_sas_base.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers

[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 --- 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/bnx2fc/bnx2fc_io.c index

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

2016-02-10 Thread Maurizio Lombardi
ping. On 10/01/2015 10:56 AM, Maurizio Lombardi wrote: > In case of error, the memory allocated for phwi_ctrlr was not freed. > > Signed-off-by: Maurizio Lombardi > --- > drivers/scsi/be2iscsi/be_main.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > d

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]

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

2015-09-21 Thread Maurizio Lombardi
s/scsi_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/-

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&m=140207797017410&w=2 Thanks, Maurizio Lombardi -- To unsubscribe from this list: send the line "unsubscri

[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 --- 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_main.c index 7a6dbfb

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

2015-10-07 Thread Maurizio Lombardi
goto done; > 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

[PATCH] st: trivial: remove form feed characters

2015-11-04 Thread Maurizio Lombardi
Signed-off-by: Maurizio Lombardi --- 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 @@ -226,7 +226,6 @@ static

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 ma

[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 --- drivers/scsi/st.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/st.c b/dri

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

2015-11-18 Thread Maurizio Lombardi
o sets STm->devs[rew] and STm->cdevs[rew] to NULL in case of failure. Signed-off-by: Maurizio Lombardi --- drivers/scsi/st.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index e0a1e52..2e52295 100644 --- a/drivers/scsi/st.c +

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 fi

[PATCH] st: fix corruption of the st_modedef structures in st_set_options()

2014-02-11 Thread Maurizio Lombardi
f4 49 [ 135.378282] RIP [] kernfs_find_ns+0x21/0x150 [ 135.384355] RSP [ 135.387881] CR2: 0098 [ 135.391298] ---[ end trace 1968409221ddb3c8 ]--- Signed-off-by: Maurizio Lombardi --- drivers/scsi/st.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff -

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

2014-02-13 Thread Maurizio Lombardi
[2] << 8) + buff[3] + 4; >+ 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 li

[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 --- drivers/scsi/st.c | 613 +++--- 1 file changed, 349 insertions(+), 264

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

2014-02-19 Thread Maurizio Lombardi
://marc.info/?l=linux-scsi&m=135003083808290&w=2 If you have a more complete 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

[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 --- 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..261af2a 100644

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

2014-03-07 Thread Maurizio Lombardi
: Maurizio Lombardi --- 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/bnx2fc/bnx2fc_hwi.c

[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 --- 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..261af2a 100644

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

2014-03-07 Thread Maurizio Lombardi
alloc_coherent(...)" fails (line 2058). 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) >

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

2014-03-10 Thread Maurizio Lombardi
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 --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/b

[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 --- 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..261af2a 100644

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

2014-03-10 Thread Maurizio Lombardi
: Maurizio Lombardi --- 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/bnx2fc/bnx2fc_hwi.c

[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 --- drivers/scsi/scsi_error.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/scsi_error.c b

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 sc

[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 --- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/b

[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 --- 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..261af2a 100644

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

2014-04-01 Thread Maurizio Lombardi
: Maurizio Lombardi --- 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/bnx2fc/bnx2fc_hwi.c

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

2014-04-01 Thread Maurizio Lombardi
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 --- 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..1903ae5 100644 --- a

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
witched > 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 messag

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
e() accepts a pointer to the sense buffer as parameter, but it does not update its content 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
e bug 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 --

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

2014-04-29 Thread Maurizio Lombardi
e bug 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 --

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

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

2014-05-01 Thread Maurizio Lombardi
tored 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 --- fs/bio.c | 48 ++-- 1

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
it is possible to merge the first 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 mes

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
thing else, it does 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://v

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

2014-05-26 Thread Maurizio Lombardi
quot; which is quite misleading 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 --- drivers/scsi/scsi_lib.c | 4 ++-- 1 file changed, 2 ins

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: &

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

2014-05-27 Thread Maurizio Lombardi
age() is called with *different* pages as parameter but physically adjacent to each other. That said it is true that maybe this branch can be extended to also cover the case I'm dealing with and try to avoid the problem that commit 3979ef4dcf introduced. Thanks, Maurizio Lombardi

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

2014-05-27 Thread Maurizio Lombardi
unction returned an error way before executing it (line 760) 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 a

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

2014-05-27 Thread Maurizio Lombardi
d the regression introduced by commit 3979ef4dcf 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: replace numeric messages with string error messages when blk_execute_rq fails. Also add printing of sense info.

2014-06-04 Thread Maurizio Lombardi
n that > area anwyay? Hannes? Did you notice this email? 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_lib: replace ambiguous "Unhandled error code" messages.

2014-06-06 Thread Maurizio Lombardi
ommand with sense code:" It's ok with me, I'm going to resend the patch in a few 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
quot; which is quite misleading 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 --- drivers/scsi/scsi_li

[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 --- drivers/scsi/pm8001/pm8001_init.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/scsi

[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 --- 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/bnx2fc/bnx2fc_io.c

Possible use after free in scsi_put_command()?

2014-06-24 Thread Maurizio Lombardi
gt;device->host, 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, M

Re: Possible use after free in scsi_put_command()?

2014-06-25 Thread Maurizio Lombardi
ou already > noticed that patch ? > 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
tom_length = 3; > strcpy(stats->custom[2].desc, "eh_abort_cnt"); > stats->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?

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 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 >

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

2014-06-25 Thread Maurizio Lombardi
eve it requires the maintainer 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 > wrote: > >> This one looks good to me, >> >> Reviewed-by: Maurizi

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

2014-06-26 Thread Maurizio Lombardi
orrect (it didn't modify 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

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

2014-06-26 Thread Maurizio Lombardi
removed. 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] 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 --- drivers/scsi/be2iscsi/be_iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scs

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 stati

[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 --- 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/be2iscsi/be_mgmt.c

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

2014-06-27 Thread Maurizio Lombardi
IG, "BG_%d : DHCP Already Enabled\n"); goto exit; } 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: [PATCHv3 1/8] target: Add locking to some accesses to nacl.device_list

2014-07-01 Thread Maurizio Lombardi
pin_unlock_irq(&nacl->device_list_lock); > + Shouldn't the spinlock unlocked before 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
t what sd_probe_async directly 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

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

2014-07-08 Thread Maurizio Lombardi
hould be removed altogether? > > > I'm 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 u

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

2014-07-09 Thread Maurizio Lombardi
Hi, On 07/09/2014 01:50 PM, Suresh Thiagarajan wrote: > From: Suresh Thiagarajan > > The pm8001_get_phy_settings_info() function does not check the > kzalloc() return value and does not free the allocated memory. This patch is already in mainline. Regards, Maurizio Lombardi >

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

2014-07-10 Thread Maurizio Lombardi
on string completely because it does not add useful information. Signed-off-by: Maurizio Lombardi --- 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 f7e

[PATCH] scsi: iscsi: flush running unbind operations when removing a session

2019-01-28 Thread Maurizio Lombardi
unbind operations */ + flush_work(&session->unbind_work); __iscsi_unbind_session(&session->unbind_work); /* hw iscsi may not have removed all connections from session */ -- Maurizio Lombardi

[PATCH] cdrom: do not call check_disk_change() inside cdrom_open()

2018-03-09 Thread Maurizio Lombardi
and then the s_umount lock. This patch fixes the issue by moving check_disk_change() out of cdrom_open() and let the caller take care of it. Signed-off-by: Maurizio Lombardi --- drivers/block/paride/pcd.c | 2 ++ drivers/cdrom/cdrom.c | 3 --- drivers/cdrom/gdrom.c | 3 +++ driv

[PATCH] scsi: use scmd_printk() to print which command timed out

2019-07-02 Thread Maurizio Lombardi
:0: timing out command, waited 20s This is not very informative because it's not possible to identify the command that timed out. This patch replaces sdev_printk() with scmd_printk(). Signed-off-by: Maurizio Lombardi --- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[RFC PATCH 0/4] iscsi: chap: introduce support for SHA1 and SHA3-256

2019-08-29 Thread Maurizio Lombardi
s. A pull request for the open-iscsi initiator side implementation has been submitted here: https://github.com/open-iscsi/open-iscsi/pull/170 Maurizio Lombardi (4): target-iscsi: CHAP: add support to SHA1 and SHA3-256 hash functions target-iscsi: remove unneeded function target-iscsi: tie the

[PATCH 1/4] target-iscsi: CHAP: add support to SHA1 and SHA3-256 hash functions

2019-08-29 Thread Maurizio Lombardi
This patches modifies the chap_server_compute_hash() function to make it agnostic to the choice of hash algorithm that is used. It also adds support to two new hash algorithms: SHA1 and SHA3-256 Signed-off-by: Maurizio Lombardi --- drivers/target/iscsi/iscsi_target_auth.c | 135

[PATCH 2/4] target-iscsi: remove unneeded function

2019-08-29 Thread Maurizio Lombardi
The digest type validy is already checked by chap_server_open(), therefore we can remove the chap_got_response() function. Signed-off-by: Maurizio Lombardi --- drivers/target/iscsi/iscsi_target_auth.c | 26 +--- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a

[PATCH 3/4] target-iscsi: tie the challenge length to the hash digest size

2019-08-29 Thread Maurizio Lombardi
Signed-off-by: Maurizio Lombardi --- drivers/target/iscsi/iscsi_target_auth.c | 37 +--- drivers/target/iscsi/iscsi_target_auth.h | 4 +-- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi

  1   2   >