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

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

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

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

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

[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

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

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

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

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

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

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

<    1   2