Re: [PATCH v2 2/3] libiscsi, iser: Adjust data_length to include protection information

2014-06-24 Thread Mike Christie
On 06/23/2014 03:59 PM, Christoph Hellwig wrote: This patch causes a regression when using the iscsi initiator over TCP for me. When mounting a newly created ext4 filesystem I get the following BUG: [ 31.611803] BUG: unable to handle kernel NULL pointer dereference at 000c

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

2014-06-24 Thread Mike Christie
On 06/11/2014 04:09 AM, Sagi Grimberg wrote: In case protection information exists on the wire scsi transports should include it in the transfer byte count (even if protection information does not exist in the host memory space). This helper will compute the total transfer length from the

Re: [PATCH 00/22] Add and use pci_zalloc_consistent

2014-06-24 Thread Johannes Berg
On Tue, 2014-06-24 at 09:27 +1000, Julian Calaby wrote: - x = (T)pci_alloc_consistent(E1,E2,E3); + x = pci_zalloc_consistent(E1,E2,E3); if ((x==NULL) || ...) S - memset((T2)x,0,E2); I don't know much about SmPL, but wouldn't having that if statement there reduce your matches? Code

Re: sd_setup_discard_cmnd: BUG: unable to handle kernel NULL pointer dereference at (null)

2014-06-24 Thread Lars Ellenberg
On Mon, Jun 23, 2014 at 03:37:03PM -0400, Martin K. Petersen wrote: Lars == Lars Ellenberg lars.ellenb...@linbit.com writes: Lars, Thanks for fixing this. I'd still like to see you use the lib call instead like you do for zeroout. I have some patches in the pipeline for multi-range

Re: [PATCHv2 RESENDv2 2/9] target: Don't unlock/relock tpg_lun_lock in loop in add_node_to_devs

2014-06-24 Thread Christoph Hellwig
- * + * Called with tpg_lun_lock held irqs off */ Instead of writing this down the code should assert the pre-conditions, e.g. assert_spin_locked(tpg-tpg_lun_lock); WARN_ON_ONCE(!irqs_disabled()); if (core_enable_device_list_for_node(lun, lacl, lacl-mapped_lun,

Re: [PATCHv2 RESENDv2 4/9] target: core_tpg_post_dellun can return void

2014-06-24 Thread Christoph Hellwig
On Mon, Jun 23, 2014 at 04:55:33PM -0700, Andy Grover wrote: Nothing in it can raise an error. Signed-off-by: Andy Grover agro...@redhat.com Looks good, Reviewed-by: Christoph Hellwig h...@lst.de -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message

Re: [PATCHv2 RESENDv2 5/9] target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun

2014-06-24 Thread Christoph Hellwig
On Mon, Jun 23, 2014 at 04:55:34PM -0700, Andy Grover wrote: Remove core_tpg_pre_dellun entirely, since we don't need to get/check a pointer we already have. Nothing else can return an error, so core_dev_del_lun can return void. Signed-off-by: Andy Grover agro...@redhat.com Looks good,

Re: [PATCHv2 RESENDv2 8/9] target: Remove core_tpg_release_virtual_lun0 function

2014-06-24 Thread Christoph Hellwig
On Mon, Jun 23, 2014 at 04:55:37PM -0700, Andy Grover wrote: Simple and just called from one place. Signed-off-by: Andy Grover agro...@redhat.com Looks good, Reviewed-by: Christoph Hellwig h...@lst.de -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a

Re: [PATCHv2 RESENDv2 6/9] target: Rename core_tpg_post_dellun to remove_lun

2014-06-24 Thread Christoph Hellwig
On Mon, Jun 23, 2014 at 04:55:35PM -0700, Andy Grover wrote: A clearer name, now that pre_dellun is gone. Signed-off-by: Andy Grover agro...@redhat.com Looks good, but might be worth merging into the previous patch. Reviewed-by: Christoph Hellwig h...@lst.de -- To unsubscribe from this list:

Re: [PATCH RESEND] target: Fix a comment in emulate_evpd_86

2014-06-24 Thread Christoph Hellwig
On Mon, Jun 23, 2014 at 05:02:08PM -0700, Andy Grover wrote: Fix comment to make it clear that check_dev_wce can return true if emulation is in use, but also if it's *not* emulated but the underlying device supports it. Reviewed-by: Chris Leech cle...@redhat.com Signed-off-by: Andy Grover

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

2014-06-24 Thread One Thousand Gnomes
On Mon, 23 Jun 2014 11:43:02 -0400 Theodore Ts'o ty...@mit.edu wrote: On Mon, Jun 23, 2014 at 08:44:40AM +0100, Al Viro wrote: OK, here it is, hopefully with sufficient comments: The comments look really good. I assume you'll get this to Linus in time for 3.16-rc3? Fixes the 32GB

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

2014-06-24 Thread Martin K. Petersen
Mike == Mike Christie micha...@cs.wisc.edu writes: Mike The problem is WRITE_SAME requests are setup so that Mike req-__data_len is the value of the entire request when the setup Mike is completed but during the setup process it's value changes Oh, I see. So things break because iSCSI uses

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

2014-06-24 Thread sagi grimberg
On 6/24/2014 9:54 AM, Mike Christie wrote: On 06/11/2014 04:09 AM, Sagi Grimberg wrote: In case protection information exists on the wire scsi transports should include it in the transfer byte count (even if protection information does not exist in the host memory space). This helper will

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

2014-06-24 Thread Sagi Grimberg
On 6/24/2014 3:53 PM, Martin K. Petersen wrote: Mike == Mike Christie micha...@cs.wisc.edu writes: Mike The problem is WRITE_SAME requests are setup so that Mike req-__data_len is the value of the entire request when the setup Mike is completed but during the setup process it's value changes

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

2014-06-24 Thread Christoph Hellwig
On Tue, Jun 24, 2014 at 08:53:25AM -0400, Martin K. Petersen wrote: Oh, I see. So things break because iSCSI uses scsi_transfer_length() where the scatterlist length was used in the past. How about this? This fixes the regression for me. -- To unsubscribe from this list: send the line

Re: [PATCH 1/5] ibmvstgt: remove

2014-06-24 Thread Christoph Hellwig
On Fri, May 23, 2014 at 11:29:57AM -0500, Brian King wrote: Adding Paul and Nathan to cc here. I'm pretty sure the backend for ibmvscsi in KVM was all done in qemu and there is no dependency on ibmvstgt. Unless there is a use case for KVM, I'm OK with this, as the ibmvstgt driver has never

Re: [PATCHv2 RESENDv2 3/9] target: Allocate se_dev_entrys in device list only when used

2014-06-24 Thread Christoph Hellwig
+ /* + * Wait for any in process SPEC_I_PT=1 or REGISTER_AND_MOVE + * PR operation to complete. + */ + while (atomic_read(deve-pr_ref_count) != 0) + cpu_relax(); A busy loop under an irq disabling spinlock is fairly nasty. Can we just remove the pointer

Re: [PATCHv2 RESENDv2 7/9] target: Allocate se_luns only when used

2014-06-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig h...@lst.de -- 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 v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-24 Thread Christoph Hellwig
On Tue, Jun 24, 2014 at 04:08:25PM +0300, Sagi Grimberg wrote: Oh, I see. So things break because iSCSI uses scsi_transfer_length() where the scatterlist length was used in the past. Ohhh, didn't notice this one and sent out a duplicate... The patch looks good to me obviously. Can you

Possible use after free in scsi_put_command()?

2014-06-24 Thread Maurizio Lombardi
Hi Hannes, I've a question regarding the asynchronous scsi abort handler, look at the scsi_put_command() function: void scsi_put_command(struct scsi_cmnd *cmd) { unsigned long flags; [...] cancel_delayed_work(cmd-abort_work); __scsi_put_command(cmd-device-host,

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

2014-06-24 Thread sagi grimberg
On 6/24/2014 3:53 PM, Martin K. Petersen wrote: SCSI: Use SCSI data buffer length to extract transfer size Commit 8846bab180fa introduced a helper that can be used to query the wire transfer size for a SCSI command taking protection information into account. However, some commands

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

2014-06-24 Thread Michael Christie
On Jun 24, 2014, at 7:53 AM, Martin K. Petersen martin.peter...@oracle.com wrote: Mike == Mike Christie micha...@cs.wisc.edu writes: Mike The problem is WRITE_SAME requests are setup so that Mike req-__data_len is the value of the entire request when the setup Mike is completed but during

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

2014-06-24 Thread Christoph Hellwig
On Tue, Jun 24, 2014 at 11:08:54AM -0500, Michael Christie wrote: static inline unsigned scsi_transfer_length(struct scsi_cmnd *scmd) { - unsigned int xfer_len = blk_rq_bytes(scmd-request); + unsigned int xfer_len = scsi_out(scmd)-length; unsigned int prot_op =

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

2014-06-24 Thread Sagi Grimberg
On 6/24/2014 7:08 PM, Michael Christie wrote: On Jun 24, 2014, at 7:53 AM, Martin K. Petersen martin.peter...@oracle.com wrote: Mike == Mike Christie micha...@cs.wisc.edu writes: Mike The problem is WRITE_SAME requests are setup so that Mike req-__data_len is the value of the entire request

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

2014-06-24 Thread Christoph Hellwig
On Tue, Jun 24, 2014 at 07:27:46PM +0300, Sagi Grimberg wrote: This condition only matters in the bidi case, which is not relevant for the PI case. I suggested to condition that in libiscsi (posted in the second thread, copy-paste below). Although I do agree that scsi_transfer_length() helper

Re: [ANNOUNCE] scsi patch queue tree

2014-06-24 Thread Christoph Hellwig
I'm also going to put together driver fixes tomorrow, as a gentle reminder to patch author: please try to look for reviewer, as I want a second pair of eyes veriying each patch. -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to

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

2014-06-24 Thread Martin K. Petersen
Mike == Michael Christie micha...@cs.wisc.edu writes: Mike Do we need to check for the data direction. Something like Mike if (scmd-sc_data_direction == DMA_TO_DEVICE) Mike xfer_len = scsi_out(scmnd)-length; Mike else Mike xfer_len = scsi_in(scmnd)-length; I guess that depends on the

Re: [ANNOUNCE] scsi patch queue tree

2014-06-24 Thread Christoph Hellwig
I've pushed another update to the core-for-3.16 branch. This includes the two error handling fixes (Ewan verified that Hannes patch fixes the issues he was seeing), and the fix for the iscsi regression: Hannes Reinecke (1): scsi_error: set DID_TIME_OUT correctly Martin K. Petersen (1):

[Bug 10554] scsi_scan doesn't set the queue depth for tape drive

2014-06-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=10554 xerofo...@gmail.com changed: What|Removed |Added CC||xerofo...@gmail.com --- Comment #1

[RFC PATCH] Let device drivers disable msi on shutdown

2014-06-24 Thread Keith Busch
I'd like to do shutdowns asynchronously so I can shutdown multiple devices in parallel, but the pci-driver disables interrupts after my driver returns from its '.shutdown', though it needs to rely on these interrupts in its asynchronously scheduled shutdown. I tracked the reason for pci disabling

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

2014-06-24 Thread Mike Christie
On 06/24/2014 11:30 AM, Christoph Hellwig wrote: On Tue, Jun 24, 2014 at 07:27:46PM +0300, Sagi Grimberg wrote: This condition only matters in the bidi case, which is not relevant for the PI case. I suggested to condition that in libiscsi (posted in the second thread, copy-paste below).

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

2014-06-24 Thread Martin K. Petersen
Mike == Mike Christie micha...@cs.wisc.edu writes: Mike It would be nice to just have one function to call and it just do Mike the right thing for the drivers. But what is the right thing when there are buffers for both directions? -- Martin K. Petersen Oracle Linux Engineering -- To

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

2014-06-24 Thread Mike Christie
On 06/24/2014 11:31 AM, Martin K. Petersen wrote: Mike == Michael Christie micha...@cs.wisc.edu writes: Mike Do we need to check for the data direction. Something like Mike if (scmd-sc_data_direction == DMA_TO_DEVICE) Mike xfer_len = scsi_out(scmnd)-length; Mike else Mike

[Bug 15562] SCSI Generic block io queueing can lock up

2014-06-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=15562 xerofo...@gmail.com changed: What|Removed |Added CC||xerofo...@gmail.com --- Comment #1

[Bug 15564] SCSI Generic queueing of insufficient dxferlen for command can succeed

2014-06-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=15564 xerofo...@gmail.com changed: What|Removed |Added CC||xerofo...@gmail.com --- Comment #1

[Bug 15566] SCSI Generic queueing info result never indicates direct data transfer?

2014-06-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=15566 xerofo...@gmail.com changed: What|Removed |Added CC||xerofo...@gmail.com --- Comment #1

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

2014-06-24 Thread Mike Christie
On 06/24/2014 12:00 PM, Mike Christie wrote: On 06/24/2014 11:30 AM, Christoph Hellwig wrote: On Tue, Jun 24, 2014 at 07:27:46PM +0300, Sagi Grimberg wrote: This condition only matters in the bidi case, which is not relevant for the PI case. I suggested to condition that in libiscsi (posted

[Bug 16058] [BUG] Cannot boot any kernel from 2.6.27 on if a 256 byte sector SCSI disk is attached

2014-06-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=16058 xerofo...@gmail.com changed: What|Removed |Added CC||xerofo...@gmail.com --- Comment #15

ATTN::: PROPOSAL

2014-06-24 Thread ST CHANG
China Steel Corporation (CSAC), is in urgent need of a reputable company,/firm or individual to serve as our financial coordinator in Canada, America, Europe, Uk. It's a part time job and pays well. If you are interested in working with us please reply: stchang...@safe-mail.net. Thank you very

RE: [RFC PATCH] Let device drivers disable msi on shutdown

2014-06-24 Thread Elliott, Robert (Server Storage)
-Original Message- From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- ow...@vger.kernel.org] On Behalf Of Keith Busch Sent: Tuesday, 24 June, 2014 11:49 AM To: linux-...@vger.kernel.org; linux-scsi@vger.kernel.org Cc: Keith Busch; Nagalakshmi Nandigama; Sreekanth Reddy;

Re: [PATCH v4 2/2] ata: Fix the dma state machine lockup for the IDENTIFY DEVICE PIO mode command.

2014-06-24 Thread Tejun Heo
Hello, On Mon, Jun 23, 2014 at 03:23:13PM +0530, Suman Tripathi wrote: This patch fixes the dma state machine lockup due to the processing of IDENTIFY DEVICE PIO mode command. The X-Gene AHCI controller has an errata in which it cannot clear the BSY bit after receiving the PIO setup FIS and

RE: [RFC PATCH] Let device drivers disable msi on shutdown

2014-06-24 Thread Keith Busch
On Tue, 24 Jun 2014, Elliott, Robert (Server Storage) wrote: 1. That will cover the .shutdown function used by mptfc.c, mptspi.c, and mptscsih.c, but mptsas.c uses mptsas_shutdown rather than mptscsih_shutdown. It doesn't call pci_disable_msi either. Missed that; thanks. 2. mptscsih_suspend

Re: sd_setup_discard_cmnd: BUG: unable to handle kernel NULL pointer dereference at (null)

2014-06-24 Thread Martin K. Petersen
Lars == Lars Ellenberg lars.ellenb...@linbit.com writes: Lars We are receiving (from network) and submitting (to lower level IO Lars stack) in the same context and would like the submit to be async. Lars Do you intend to provide an asynchronous interface? I guess we can look into that if there

[PATCH] cleanup switch in scsi_adjust_queue_depth()

2014-06-24 Thread Douglas Gilbert
While checking what scsi_adjust_queue_depth() did I thought its switch statement could be clearer. ChangeLog: - remove redundant assignment (to sdev-queue_depth) - re-order cases (thus removing the fall-through) Signed-off-by: Douglas Gilbert dgilb...@interlog.com ---

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

2014-06-24 Thread Vladislav Bolkhovitin
Martin K. Petersen, on 06/23/2014 06:58 PM wrote: Mike == Mike Christie micha...@cs.wisc.edu writes: + unsigned int xfer_len = blk_rq_bytes(scmd-request); Mike Can you do bidi and dif/dix? Nope. Correction: at the moment. There is a proposal of READ GATHERED command, which is

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

2014-06-24 Thread Mike Christie
On 06/24/2014 12:08 PM, Mike Christie wrote: On 06/24/2014 12:00 PM, Mike Christie wrote: On 06/24/2014 11:30 AM, Christoph Hellwig wrote: On Tue, Jun 24, 2014 at 07:27:46PM +0300, Sagi Grimberg wrote: This condition only matters in the bidi case, which is not relevant for the PI case. I