Re: [PATCH] sg: limit maximum cdb size to 252 bytes

2014-06-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- 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 2/6] scsi: Implement sg_printk()

2014-06-26 Thread Christoph Hellwig
On Wed, Jun 25, 2014 at 04:21:19PM -0400, Douglas Gilbert wrote: > That function used to be called sg_cmd_done() but > another hacker gave it a more reasonable name (?) > but neglected to fix the printk_s. There are other > examples, so now I prefer: > > SCSI_LOG_TIMEOUT(4, sg_printk(KERN_INFO,

Re: [PATCH] scsi: pm8001: pm80xx_hwi.c: Cleaning up uninitialized variables

2014-06-26 Thread Jack Wang
Looks good, thanks Rickard. Acked-by: Jack Wang On 06/01/2014 03:13 PM, Rickard Strandqvist wrote: > There is a risk that the variable will be used without being initialized. > > This was largely found by using a static code analysis program called > cppcheck. > > Signed-off-by: Rickard Strandq

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

2014-06-26 Thread Maurizio Lombardi
Hi, On 06/26/2014 02:28 AM, Rickard Strandqvist wrote: > > If it's not obvious, I do all my fixes without changing the previous > intent. But obviously it is not always right, rather it is one of main > reasons to fix this type of error :) Yes it is obvious, your patch was correct (it didn't mod

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

2014-06-26 Thread Jack Wang
Thanks Rickard, >From my point of view, looks good, but I'd like to get review from Anand (cc-ed). Anand, could you share your opinion? Regards, Jack On 06/25/2014 04:01 PM, Rickard Strandqvist wrote: > A struct member variable is set to different values without having used in > between. > >

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

[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/scsi/be2iscsi/b

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

2014-06-26 Thread Rickard Strandqvist
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-off-by: Rickard Strandqvist --- drivers/scsi/bnx2i/bnx2i_iscsi.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

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

2014-06-26 Thread Joe Perches
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 [] > @@ -1643,12 +1643,11 @@ static void bnx2i_conn_get_sta

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

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

2014-06-26 Thread Joe Perches
On Thu, 2014-06-26 at 14:12 +0200, Maurizio Lombardi wrote: > > 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/drive

[PATCH] [scsi] 3w-xxxx: fix mis-aligned struct accesses

2014-06-26 Thread Arnd Bergmann
Building an allmodconfig ARM kernel, I get multiple such warnings because of a spinlock contained in packed structure in the 3w- driver: ../drivers/scsi/3w-.c: In function 'tw_chrdev_ioctl': ../drivers/scsi/3w-.c:1001:68: warning: mis-aligned access used for structure member [-fstrict

[PATCH] [SCSI] hpsa: fix non-x86 builds

2014-06-26 Thread Arnd Bergmann
commit 28e134464734 "[SCSI] hpsa: enable unit attention reporting" turns on unit attention notifications, but got the change wrong for all architectures other than x86, which now store an uninitialized value into the device register. Gcc helpfully warns about this: ../drivers/scsi/hpsa.c: In func

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread James Bottomley
On Wed, 2014-06-25 at 06:13 -0700, Christoph Hellwig wrote: > On Thu, Jun 19, 2014 at 11:05:59AM -0700, James Bottomley wrote: > > That's not really a good idea either ... I did think of it. We'll end > > up with a cmd_type of REQ_TYPE_FS which because of REQ_FLUSH (or REQ_FUA > > or REQ_DISCARD

how to firing device event when SD card inserting usb card reader

2014-06-26 Thread loody
hi all: I try below flow: 1. plug in usb card reader 2. wait 2 seconds 3. plug in SD card on ubuntu PC system, the udev can get SD plug in event but on my embedded system, there is no udev plug event when SD plug in. Is this issue related to media change command? if so, should I enable kernel con

Re: [PATCH] [SCSI] hpsa: fix non-x86 builds

2014-06-26 Thread scameron
On Thu, Jun 26, 2014 at 03:44:52PM +0200, Arnd Bergmann wrote: > commit 28e134464734 "[SCSI] hpsa: enable unit attention reporting" > turns on unit attention notifications, but got the change wrong for > all architectures other than x86, which now store an uninitialized > value into the device regi

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread Bart Van Assche
On 06/11/14 11:09, Sagi Grimberg wrote: > + return xfer_len + (xfer_len >> ilog2(sector_size)) * 8; Sorry that I just noticed this now, but why is a shift-right and ilog2() used in the above expression instead of just dividing the transfer length by the sector size ? Thanks, Bart. -- To uns

Re: [PATCH] sg: limit maximum cdb size to 252 bytes

2014-06-26 Thread Ewan Milne
On Wed, 2014-06-25 at 13:05 -0400, Douglas Gilbert wrote: > Boaz Harrosh commented on the "[PATCH v5] sg: relax 16 > byte cdb restriction" thread that SCSI variable length > commands (which are all SCSI commands greater than 16 > bytes long) must themselves be a multiple of 4 bytes > long. > > Cha

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread Christoph Hellwig
On Thu, Jun 26, 2014 at 10:02:47AM -0400, James Bottomley wrote: > Yes, but think what you're proposing. Every block command with a > special setup goes via scsi_setup_blk_pc_cmnd() because they usually > have to translate to something special. That logic is backwards. The "special" commands use

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread James Bottomley
On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote: > On 06/11/14 11:09, Sagi Grimberg wrote: > > + return xfer_len + (xfer_len >> ilog2(sector_size)) * 8; > > Sorry that I just noticed this now, but why is a shift-right and ilog2() > used in the above expression instead of just dividing t

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread Christoph Hellwig
Hi Steven, can you test the patch below? diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index f7e3163..9b56e48 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -733,6 +733,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread James Bottomley
On Thu, 2014-06-26 at 08:00 -0700, Christoph Hellwig wrote: > On Thu, Jun 26, 2014 at 10:02:47AM -0400, James Bottomley wrote: > > Yes, but think what you're proposing. Every block command with a > > special setup goes via scsi_setup_blk_pc_cmnd() because they usually > > have to translate to some

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread Christoph Hellwig
On Thu, Jun 26, 2014 at 11:04:56AM -0400, James Bottomley wrote: > Right, but look what we do for the specials. The only difference is the > ULD has a hook to generate the CDB. For everything else we follow the > BLOCK_PC path, including error handling and sense data processing. No, we don't use

[PATCH 2/4] pm8001: honor return value

2014-06-26 Thread Tomas Henzl
The driver ignores the return value in a lot of places, fix it at least somewhere (and release the resources in such cases), to avoid that bad things happen. Signed-off-by: Tomas Henzl --- drivers/scsi/pm8001/pm8001_hwi.c | 27 +++--- drivers/scsi/pm8001/pm80xx_hwi.c | 41 +++

[PATCH 3/4] pm8001: add a new spinlock to protect the CCB

2014-06-26 Thread Tomas Henzl
Patch adds a new spinlock to protect the ccb management. It may happen that concurrent threads become the same tag value from the 'alloc' function', the spinlock prevents this situation. Signed-off-by: Tomas Henzl --- drivers/scsi/pm8001/pm8001_init.c | 1 + drivers/scsi/pm8001/pm8001_sas.c |

[PATCH 4/4] pm8001: more fixes to honor return value

2014-06-26 Thread Tomas Henzl
The driver ignores the return value in a lot of places, fix it at least somewhere (and release the resources in such cases), to avoid that bad things happen. A memory leak is fixed too. Signed-off-by: Tomas Henzl --- drivers/scsi/pm8001/pm8001_ctl.c | 5 - drivers/scsi/pm8001/pm8001_init.

[PATCH 1/4] pm8001: clean bitmap management functions

2014-06-26 Thread Tomas Henzl
In the driver two different functions are used to free the same resource, this patch makes the code easier to read. In addittion to that, some minor optimisations were made too. Signed-off-by: Tomas Henzl --- drivers/scsi/pm8001/pm8001_hwi.c | 10 +- drivers/scsi/pm8001/pm8001_sas.c | 31

Re: [regression] fix 32-bit breakage in block device read(2) (was Re: 32-bit bug in iovec iterator changes)

2014-06-26 Thread Bruno Wolff III
On Mon, Jun 23, 2014 at 08:44:40 +0100, Al Viro wrote: blkdev_read_iter() wants to cap the iov_iter by the amount of data remaining to the end of device. That's what iov_iter_truncate() is for (trim iter->count if it's above the given limit). So far, so good, but the argument of iov_iter_tru

Erschwingliche Darlehen @ 3%

2014-06-26 Thread CENTRAL TRUST LOAN COMPANY
Gruß Wir (CENTRAL TRUST LOAN COMPANY), und wir bieten eine breite Palette von Finanzdienstleistungen Handel, Darlehen, sowohl für einzelne als auch für co-Arbeitsgremien mit einem angemessenen Zinssatz von 3 %. Wenn Sie finanzielle Hilfe angewiesen sind oder Darlehen begleichen Ihre Forderungsa

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread Atchley, Scott
On Jun 26, 2014, at 10:55 AM, James Bottomley wrote: > On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote: >> On 06/11/14 11:09, Sagi Grimberg wrote: >>> + return xfer_len + (xfer_len >> ilog2(sector_size)) * 8; >> >> Sorry that I just noticed this now, but why is a shift-right and ilog

Re: how to firing device event when SD card inserting usb card reader

2014-06-26 Thread Alan Stern
On Thu, 26 Jun 2014, loody wrote: > hi all: > I try below flow: > 1. plug in usb card reader > 2. wait 2 seconds > 3. plug in SD card > > on ubuntu PC system, the udev can get SD plug in event > but on my embedded system, there is no udev plug event when SD plug in. > > Is this issue related to

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread James Bottomley
On June 26, 2014 11:41:48 AM EDT, "Atchley, Scott" wrote: >On Jun 26, 2014, at 10:55 AM, James Bottomley > wrote: > >> On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote: >>> On 06/11/14 11:09, Sagi Grimberg wrote: + return xfer_len + (xfer_len >> ilog2(sector_size)) * 8; >>> >>> So

[PATCH v3] scsi: bnx2i: bnx2i_iscsi.c: Fix variable which was set to the wrong value

2014-06-26 Thread Rickard Strandqvist
After some discussion, all agreed that the previous value was incorrect. Signed-off-by: Rickard Strandqvist --- drivers/scsi/bnx2i/bnx2i_iscsi.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index 1665

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread Steven Haber
Sure, I'll run it overnight. On Thu, Jun 26, 2014 at 8:02 AM, Christoph Hellwig wrote: > Hi Steven, > > can you test the patch below? > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index f7e3163..9b56e48 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread James Bottomley
On Thu, 2014-06-26 at 08:08 -0700, Christoph Hellwig wrote: > On Thu, Jun 26, 2014 at 11:04:56AM -0400, James Bottomley wrote: > > Right, but look what we do for the specials. The only difference is the > > ULD has a hook to generate the CDB. For everything else we follow the > > BLOCK_PC path, i

Re: SCSI eats error from flush failure during hot plug

2014-06-26 Thread James Bottomley
On Thu, 2014-06-26 at 08:02 -0700, Christoph Hellwig wrote: > Hi Steven, > > can you test the patch below? > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index f7e3163..9b56e48 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -733,6 +733,14 @@ void

External USB3 disk fails with "Invalid field in cdb"

2014-06-26 Thread Michael Büsch
Hi, I got a new USB3->SATA adapter that throws the following errors when trying to mount the ext4 file system on the attached disk. Jun 26 20:47:11 wiggum kernel: [156016.840175] usb 4-2: new SuperSpeed USB device number 8 using xhci_hcd Jun 26 20:47:11 wiggum kernel: [156016.856962] usb 4-2: Ne

Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread Atchley, Scott
On Jun 26, 2014, at 12:38 PM, James Bottomley wrote: > On June 26, 2014 11:41:48 AM EDT, "Atchley, Scott" wrote: >> On Jun 26, 2014, at 10:55 AM, James Bottomley >> wrote: >> >>> On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote: On 06/11/14 11:09, Sagi Grimberg wrote: > + ret

RE: scsi-mq V2

2014-06-26 Thread Elliott, Robert (Server Storage)
> -Original Message- > From: Jens Axboe [mailto:ax...@kernel.dk] > Sent: Wednesday, 25 June, 2014 11:51 PM > To: Christoph Hellwig; James Bottomley > Cc: Bart Van Assche; Elliott, Robert (Server Storage); linux- > s...@vger.kernel.org; linux-ker...@vger.kernel.org > Subject: Re: scsi-mq V

[PATCH] ibmvfc: fix little endian issues

2014-06-26 Thread Tyrel Datwyler
Added big endian annotations to relevant data structure fields, and necessary byte swappings to support little endian builds. Signed-off-by: Brian King Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 473 + drivers/scsi/ibmvscsi/ibmvfc.

Re: [PATCH v3] scsi: bnx2i: bnx2i_iscsi.c: Fix variable which was set to the wrong value

2014-06-26 Thread Mike Christie
On 06/26/2014 12:10 PM, Rickard Strandqvist wrote: > After some discussion, all agreed that the previous value was incorrect. > > Signed-off-by: Rickard Strandqvist This is better but still sort of incorrect as userspace would be getting 2 bogus entries at indexes 0 and 1. be2iscsi is also broke

Re: [RFC][PATCH 1/5 v2] tracing: Add trace_seq_buffer_ptr() helper function

2014-06-26 Thread James Bottomley
On Thu, 2014-06-26 at 21:06 -0400, Steven Rostedt wrote: > As this patch is in my 3.17 queue and it touches the kvm and scsi > tracepoint code, I figured I should at least do the courtesy of > notifying the maintainers of those subsystems. > > Do you have any issues with this going through my tree

Re: [PATCH] target: fix deadlock on unload

2014-06-26 Thread Nicholas A. Bellinger
Hi Mikulas, On Mon, 2014-06-23 at 13:42 -0400, Mikulas Patocka wrote: > target: fix deadlock on unload > > On uniprocessor preemptible kernel, target core deadlocks on unload. The > following events happen: > * iscsit_del_np is called > * it calls send_sig(SIGINT, np->np_thread, 1); > * the sched

Wir erwarten Ihre Antwort.

2014-06-26 Thread Altura Credit Union
-- Attn: Hallo! Ich bin ein berechtigtes Darlehen Agent Larry Faith von Altura Credit Union Management; Wir bieten Finanzierungslösungen für Unternehmen und hart arbeiten, um unsere Kunden zu gewährleisten, die richtige Entscheidung darüber, die welche Anlage am besten für sie und ihr Gesch

[PATCH 1/7] scsi: fix comment in scsi_device_set_state()

2014-06-26 Thread Hannes Reinecke
The function returns '0' if successful; with the original comment the function doesn't have a way to indicate success ... Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib

[PATCH 3/7] ibmvfc: Do not call fc_block_scsi_eh() on host reset

2014-06-26 Thread Hannes Reinecke
When we're resetting the host any remote port states will be reset anyway, so it's pointless to wait for dev_loss_tmo during host reset. Signed-off-by: Hannes Reinecke Cc: Brian King --- drivers/scsi/ibmvscsi/ibmvfc.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/ibmvscsi/

RE: [PATCH 3/4] pm8001: add a new spinlock to protect the CCB

2014-06-26 Thread Viswas G
HI Tomas, This lock is not needed as we are already protecting the tag allocation and freeing with the pm8001_ha->lock. We are always acquiring this lock before calling pm8001_tag_alloc(). We are allocating and freeing the tag in following paths, 1) Request/Response path : This we are protec

[PATCH 0/7] Use 'Scsi_Host' as argument for host reset

2014-06-26 Thread Hannes Reinecke
eh_host_reset_handler can only depend on the Scsi_Host, so we should make that explicit by using 'struct Scsi_Host' as argument for it. This uncovered issues with some FC HBAs; calling 'fc_block_scsi_eh' _before_ host reset is not only pointless (the host reset will reset the rport state anyway),

[PATCH 5/7] scsi_transport_fc: Use fc_rport as argument for fc_block_scsi_eh

2014-06-26 Thread Hannes Reinecke
fc_block_scsi_eh() works on a remote port, so we should be using that as an argument and not the scsi command. Signed-off-by: Hannes Reinecke Cc: James Smart --- drivers/s390/scsi/zfcp_scsi.c | 9 ++--- drivers/scsi/bnx2fc/bnx2fc_io.c | 4 ++-- drivers/scsi/csiostor/csio_scsi.c | 4

[PATCH 2/7] mptfc: Do not call fc_block_scsi_eh() on host reset

2014-06-26 Thread Hannes Reinecke
When we're resetting the host any remote port states will be reset anyway, so it's pointless to wait for dev_loss_tmo during host reset. Signed-off-by: Hannes Reinecke Cc: Sreekanth Reddy --- drivers/message/fusion/mptfc.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --

[PATCH 7/7] scsi_error: do not use command list for host reset

2014-06-26 Thread Hannes Reinecke
When host reset is called the host should be reset, and not depend on any commands on the queue. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi_error.c | 40 ++-- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/scsi_error.c b

[PATCH 4/7] libfc: Do not call fc_block_scsi_eh() on host reset

2014-06-26 Thread Hannes Reinecke
When we're resetting the host any remote port states will be reset anyway, so it's pointless to wait for dev_loss_tmo during host reset. Signed-off-by: Hannes Reinecke Cc: Vasu Dev --- drivers/scsi/libfc/fc_fcp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/libfc/fc_fcp.c b