Re: [PATCH] mptscsih: remove bogus interpretation of request->ioprio

2016-10-14 Thread Martin K. Petersen
> "Christoph" == Christoph Hellwig  writes:

Christoph> Having an I/O priority does not mean we should send all
Christoph> requests as HEAD OF QUEUE tags.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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: ufs: changing maintainer

2016-10-14 Thread Martin K. Petersen
> "Joao" == Joao Pinto  writes:

Joao> I am going to leave Synopsys and so this patch changes the
Joao> Maintainer for UFS Synopsys' specific drivers to my colleagues
Joao> Manjunath and Prabu.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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 00/24] FCoE VN2VN fixes, part two

2016-10-14 Thread Martin K. Petersen
> "Hannes" == Hannes Reinecke  writes:

Hannes> Hi all, here's now the second part of my FCoE VN2VN patchset.
Hannes> The key points are:
Hannes> - Configurable R_A_TOV/E_D_TOV
Hannes> - Rework PRLI handling to fix a longstanding bug
Hannes> - Correctly handle timed-out xids

Hannes> Additionally there are some minor fixes to get things to work
Hannes> when running with FCoE over virtio.

Hannes> Patches are relative to mkp/4.10/scsi-queue.

Hannes> As usual, comments and reviews are welcome.

Somebody please review patches 11, 13, 14, 18, 19, 20, 22, 23 and 24.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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: [RESEND PATCH] scsi: ufs: fix race between clock gating and devfreq scaling work

2016-10-14 Thread Martin K. Petersen
> "Subhash" == Subhash Jadavani  writes:

Subhash> UFS devfreq clock scaling work may require clocks to be ON if
Subhash> it need to execute some UFS commands hence it may request for
Subhash> clock hold before issuing the command. But if UFS clock gating
Subhash> work is already running in parallel, ungate work would end up
Subhash> waiting for the clock gating work to finish and as clock gating
Subhash> work would also wait for the clock scaling work to finish, we
Subhash> would enter in deadlock state. Here is the call trace during
Subhash> this deadlock state:

Somebody from the UFS camp, please review!

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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 0/2] Locking issue in libiscsi and be2iscsi

2016-10-14 Thread Martin K. Petersen
> "Jitendra" == Jitendra Bhivare  writes:

Jitendra> These patches are being resent with required changes as per
Jitendra> comments for [PATCH 02/28] be2iscsi: Replace _bh with
Jitendra> _irqsave/irqrestore

Jitendra> In IO handling path, there is no spin_lock taken with IRQs
Jitendra> disabled when calling into libiscsi, so no issues were found
Jitendra> with use of spin_lock_bh/spin_unlock_bh except for one in
Jitendra> iscsi_eh_cmd_timeout.

Somebody please review.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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 11/24] libfc: Return LS_RJT_BUSY for PRLI in status PLOGI

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

Occasionally it might happen that we receive a PRLI while we're still
waiting for our PLOGI response. In that case we should return
'busy' LS status instead of 'plogi required' LS status.


Reviewed-by: Bart Van Assche 
--
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 13/24] libfc: safeguard against invalid exchange index

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

The cached exchange index might be invalid, in which case
we should drop down to allocate a new one.
And we should not try to access an invalid exchange when
responding to a BA_ABTS.


Reviewed-by: Bart Van Assche 
--
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 14/24] libfc: quarantine timed out xids

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

When a sequence times out we have no idea what happened to the
frame. And we do not know if we will ever receive the frame.
Hence we cannot re-use the xid as we would risk data corruption
if the xid had been re-used and the timed out frame would be
received after that.
So we need to quarantine the xid until the lport is reset.
Yes, I know this will (eventually) deplete the xid pool.
But for now it's the safest method.


Reviewed-by: Bart Van Assche 
--
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 19/24] libfc: Check xid when looking up REC exchanges

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

We currently can only lookup the local xid, so we need
to reject REC with empty rxid.


Reviewed-by: Bart Van Assche 
--
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 18/24] libfc: wait for E_D_TOV when out-of-order sequence is received

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

When detecting an out-of-order sequence we should be waiting for
E_D_TOV before trying to abort the sequence.
The response might still be stuck in the queue somewhere.


Reviewed-by: Bart Van Assche 
--
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 22/24] fcoe: FIP debugging

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

Add additional statements for debugging FIP frames.

> [ ... ]

@@ -2442,15 +2446,21 @@ static void fcoe_ctlr_vn_probe_req(struct fcoe_ctlr 
*fip,
 */
if (fip->lp->wwpn > rdata->ids.port_name &&
!(frport->flags & FIP_FL_REC_OR_P2P)) {
+   LIBFCOE_FIP_DBG(fip, "vn_probe_req: "
+   "port_id collision\n");
fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REP,
  frport->enode_mac, 0);


Hmm ... checkpatch should have complained about this and should have 
recommended to keep the format string on a single line. Anyway:


Reviewed-by: Bart Van Assche 

--
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 23/24] fcoe: correct sending FIP VLAN packets on VLAN 0

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

The FIP VLAN frame consists of an ethernet header followed
by the FIP VLAN frame, so we need to skip the ethernet header
if we want to check the FIP opcode.


Reviewed-by: Bart Van Assche 
--
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 24/24] fcoe: filter out frames from invalid vlans

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:11 AM, Hannes Reinecke wrote:

Any multicase address is set on all interfaces, the base interface
and any VLAN interfaces on top of this. So we might receive frames
which are not destined for us.


Reviewed-by: Bart Van Assche 
--
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 20/24] fcoe: set default TC priority

2016-10-14 Thread Bart Van Assche

On 10/13/2016 06:10 AM, Hannes Reinecke wrote:

If DCB is not enabled or compiled in we still should be setting
a sane default priority. So put FCoE frames in priority class
'interactive' and FIP frames in priority class 'besteffort'.


Reviewed-by: Bart Van Assche 
--
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 00/12] Fixes, cleanup and g_NCR5380_mmio/g_NCR5380 merger

2016-10-14 Thread Martin K. Petersen
> "Finn" == Finn Thain  writes:

Finn> This patch series has fixes for compatibility, reliability and
Finn> performance issues and some cleanup. It also includes a new
Finn> version of Ondrej Zary's patch that merges g_NCR5380_mmio into
Finn> g_NCR5380.

Finn> I've tested this patch series on a Powerbook 180. If someone would
Finn> test some of the other platforms that would be very helpful. All
Finn> drivers were compile-tested.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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: [Open-FCoE] Revert commit 3e22760d4db6fd89e0be46c3d132390a251da9c6 due to performance issues

2016-10-14 Thread Martin K. Petersen
> "Laurence" == Laurence Oberman  writes:

Laurence> This patch reverts commit
Laurence> 3e22760d4db6fd89e0be46c3d132390a251da9c6.

Laurence> This revert came about because of efforts by Ewan Milne,
Laurence> Curtis Taylor and I.  In researching this issue, significant
Laurence> performance issues were seen on large CPU count systems using
Laurence> the software FCOE stack.  Hannes also weighed in.

Laurence> The same was not apparent on much smaller low count CPU
Laurence> systems.  The behavior introduced by commit
Laurence> 3e22760d4db6fd89e0be46c3d132390a251da9c6 lands sup with large
Laurence> count CPU systems seeing continual blk_requeue_request() calls
Laurence> due to ML_QUEUE_HOST_BUSY.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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 1/1] [4.9-rc] ipr: Fix async error WARN_ON

2016-10-14 Thread Martin K. Petersen
> "Brian" == Brian King  writes:

Brian> Commit afc3f83cb4a5 ("scsi: ipr: Add asynchronous error
Brian> notification") introduced the warn on shown below. To fix this,
Brian> rather than attempting to send the KOBJ_CHANGE uevent from
Brian> interrupt context, which is what is causing the WARN_ON, just
Brian> wake the ipr worker thread which will send a KOBJ_CHANGE uevent.

Applied to 4.9/scsi-fixes.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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: hpsa: remove unneeded void pointer cast

2016-10-14 Thread Martin K. Petersen
> "Javier" == Javier Martinez Canillas  writes:

Javier> It's not necessary to cast the result of kmalloc, since void
Javier> pointers are promoted to any other type. This also fixes
Javier> following coccinelle warning:

Javier> casting value returned by memory allocation function to
Javier> (BIG_IOCTL_Command_struct *) is useless.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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] zfcp: spin_lock_irqsave() is not nestable

2016-10-14 Thread Martin K. Petersen
> "Steffen" == Steffen Maier  writes:

Steffen> could you please queue this as fix for one of my patches that
Steffen> went into the 4.9 merge window, so for 4.9-rc I guess?

Applied to 4.9/scsi-fixes.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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 v3 00/17] lpfc: Update driver to version 11.2.0.2

2016-10-14 Thread Martin K. Petersen
> "James" == James Smart  writes:

James> This patch set updates the lpfc driver to revision 11.2.0.2

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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] MAINTAINERS: remove defunct iss storage mailing list

2016-10-14 Thread Martin K. Petersen
> "Javier" == Javier Martinez Canillas  writes:

Javier> It appears that the mailing list email address doesn't exist
Javier> anymore: : host smtp.hp.com[15.73.96.116]
Javier> said: 550 5.1.1
Javier> : Recipient address rejected: User
Javier> unknown in virtual alias table (in reply to RCPT TO command)

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
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 v3 05/17] lpfc: Make lpfc_prot_xxx params per hba parameters

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Make lpfc_prot_mask and lpfc_prot_guard per hba parameters
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc.h  |  2 ++
>  drivers/scsi/lpfc/lpfc_attr.c | 23 ++-
>  drivers/scsi/lpfc/lpfc_crtn.h |  2 --
>  drivers/scsi/lpfc/lpfc_init.c | 28 +++-
>  4 files changed, 31 insertions(+), 24 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 06/17] lpfc: Code clean up for lpfc_iocb_cnt parameter

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Code clean up for lpfc_iocb_cnt parameter
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 8 +---
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
> index be81e61..e5092dc 100644
> --- a/drivers/scsi/lpfc/lpfc_attr.c
> +++ b/drivers/scsi/lpfc/lpfc_attr.c
> @@ -2827,14 +2827,8 @@ lpfc_txcmplq_hw_show(struct device *dev, struct 
> device_attribute *attr,
>  static DEVICE_ATTR(txcmplq_hw, S_IRUGO,
>lpfc_txcmplq_hw_show, NULL);
>  
> -int lpfc_iocb_cnt = 2;
> -module_param(lpfc_iocb_cnt, int, S_IRUGO);
> -MODULE_PARM_DESC(lpfc_iocb_cnt,
> +LPFC_ATTR_R(iocb_cnt, 2, 1, 5,
>   "Number of IOCBs alloc for ELS, CT, and ABTS: 1k to 5k IOCBs");
> -lpfc_param_show(iocb_cnt);
> -lpfc_param_init(iocb_cnt, 2, 1, 5);
> -static DEVICE_ATTR(lpfc_iocb_cnt, S_IRUGO,
> -  lpfc_iocb_cnt_show, NULL);
>  
>  /*
>  # lpfc_nodev_tmo: If set, it will hold all I/O errors on devices that 
> disappear
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 07/17] lpfc: Code cleanup for lpfc_enable_rrq parameter

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Code cleanup for lpfc_enable_rrq parameter
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 8 ++--
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
> index e5092dc..22a66c7 100644
> --- a/drivers/scsi/lpfc/lpfc_attr.c
> +++ b/drivers/scsi/lpfc/lpfc_attr.c
> @@ -2759,18 +2759,14 @@ LPFC_ATTR_R(enable_npiv, 1, 0, 1,
>  LPFC_ATTR_R(fcf_failover_policy, 1, 1, 2,
>   "FCF Fast failover=1 Priority failover=2");
>  
> -int lpfc_enable_rrq = 2;
> -module_param(lpfc_enable_rrq, int, S_IRUGO);
> -MODULE_PARM_DESC(lpfc_enable_rrq, "Enable RRQ functionality");
> -lpfc_param_show(enable_rrq);
>  /*
>  # lpfc_enable_rrq: Track XRI/OXID reuse after IO failures
>  #0x0 = disabled, XRI/OXID use not tracked.
>  #0x1 = XRI/OXID reuse is timed with ratov, RRQ sent.
>  #0x2 = XRI/OXID reuse is timed with ratov, No RRQ sent.
>  */
> -lpfc_param_init(enable_rrq, 2, 0, 2);
> -static DEVICE_ATTR(lpfc_enable_rrq, S_IRUGO, lpfc_enable_rrq_show, NULL);
> +LPFC_ATTR_R(enable_rrq, 2, 0, 2,
> + "Enable RRQ functionality");
>  
>  /*
>  # lpfc_suppress_link_up:  Bring link up at initialization
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 08/17] lpfc: Code cleanup for lpfc_aer_support parameter

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Code cleanup for lpfc_aer_support parameter
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 43 
> +++
>  1 file changed, 3 insertions(+), 40 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 09/17] lpfc: Code cleanup for lpfc_topology parameter

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Code cleanup for lpfc_topology parameter
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 7 +++
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 02/16] scsi: don't use fc_bsg_job::request and fc_bsg_job::reply directly

2016-10-14 Thread Johannes Thumshirn
On Thu, Oct 13, 2016 at 05:55:11PM +0200, Steffen Maier wrote:
> Hm, still behaves for me like I reported for v2:
> http://marc.info/?l=linux-scsi=147637177902937=2

Hi Steffen,

Can you please try the following on top of 2/16?

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 4149dac..baebaab 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -3786,6 +3786,12 @@ enum fc_dispatch_result {
int cmdlen = sizeof(uint32_t);  /* start with length of msgcode */
int ret;
 
+   /* check if we really have all the request data needed */
+   if (job->request_len < cmdlen) {
+   ret = -ENOMSG;
+   goto fail_host_msg;
+   }
+
/* Validate the host command */
switch (bsg_request->msgcode) {
case FC_BSG_HST_ADD_RPORT:
@@ -3831,12 +3837,6 @@ enum fc_dispatch_result {
goto fail_host_msg;
}
 
-   /* check if we really have all the request data needed */
-   if (job->request_len < cmdlen) {
-   ret = -ENOMSG;
-   goto fail_host_msg;
-   }
-
ret = i->f->bsg_request(job);
if (!ret)
return FC_DISPATCH_UNLOCKED;
@@ -3887,6 +3887,12 @@ enum fc_dispatch_result {
int cmdlen = sizeof(uint32_t);  /* start with length of msgcode */
int ret;
 
+   /* check if we really have all the request data needed */
+   if (job->request_len < cmdlen) {
+   ret = -ENOMSG;
+   goto fail_rport_msg;
+   }
+
/* Validate the rport command */
switch (bsg_request->msgcode) {
case FC_BSG_RPT_ELS:



The rational behind this is, in fc_req_to_bsgjob() we're assigning
job->request as req->cmd and job->request_len = req->cmd_len. But without
checkinf job->request_len we don't know whether we're save to touch
job->request (a.k.a. bsg_request).

In the meanwhile I try to reproduce your report here.

Thanks,
Johannes
-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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 v3 15/17] lpfc: Synchronize link speed with boot driver

2016-10-14 Thread Johannes Thumshirn
On Thu, Oct 13, 2016 at 03:06:16PM -0700, James Smart wrote:
> 
> Synchronize link speed with boot driver
> 
> Link speed settings set by the boot driver are reported by the hw.
> Driver will attempt to read them, and if set, will respect their
> values.
> The driver can override the settings with its own if instructed by
> user space (via bsg), with the new values being picked up by the
> boot driver.
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> ---
> v3 mods:
>  parens cleanup
>  use shost_priv() on new code
> 

Thanks,
Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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 v3 02/17] lpfc: Correct embedded io wq element size

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Correct embedded io wq element size. Embedded element sizes are
> 128 byte elements
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
> v2 mods:
>  change style of selecting wqesize using local variable
> 
>  drivers/scsi/lpfc/lpfc_init.c | 14 +-
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 03/17] lpfc: Fix sg_reset on SCSI device causing kernel crash

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Fix sg_reset on SCSI device causing kernel crash
> 
> Driver could reference stale node pointers in task mgmt call.
> Changed to use resetting cmd and look up node pointer in task mgmt
> function.
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
> v2 mods:
>  Revised lpfc_send_taskmgmt() to check rdata
> 
>  drivers/scsi/lpfc/lpfc_scsi.c | 22 +-
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 04/17] lpfc: Set driver environment data on adapter

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Set driver environment data on adapter
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_hw4.h | 12 
>  drivers/scsi/lpfc/lpfc_sli.c | 29 +
>  2 files changed, 41 insertions(+)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 01/17] Fix few small typos in lpfc_scsi.c

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> From: "Milan P. Gandhi" 
> 
> This patch does a cleanup and fixes few small typos in lpfc_scsi.c
> 
> Signed-off-by: Milan P. Gandhi 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  
>  drivers/scsi/lpfc/lpfc_scsi.c | 21 -
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 15/17] lpfc: Synchronize link speed with boot driver

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Synchronize link speed with boot driver
> 
> Link speed settings set by the boot driver are reported by the hw.
> Driver will attempt to read them, and if set, will respect their
> values.
> The driver can override the settings with its own if instructed by
> user space (via bsg), with the new values being picked up by the
> boot driver.
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> ---
> v3 mods:
>  parens cleanup
>  use shost_priv() on new code
> 
>  drivers/scsi/lpfc/lpfc.h  |  4 
>  drivers/scsi/lpfc/lpfc_attr.c |  7 +-
>  drivers/scsi/lpfc/lpfc_bsg.c  | 45 
>  drivers/scsi/lpfc/lpfc_bsg.h  | 10 
>  drivers/scsi/lpfc/lpfc_hw4.h  |  3 +++
>  drivers/scsi/lpfc/lpfc_init.c | 54 
> +++
>  6 files changed, 122 insertions(+), 1 deletion(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 10/17] lpfc: Code cleanup for lpfc_max_scsicmpl_time parameter

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Code cleanup for lpfc_max_scsicmpl_time parameter
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 11/17] lpfc: Code cleanup for lpfc_sriov_nr_virtfn parameter

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Code cleanup for lpfc_sriov_nr_virtfn parameter
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 35 +++
>  1 file changed, 3 insertions(+), 32 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 14/17] lpfc: Correct panics with eh_timeout and eh_deadline

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Correct panics with eh_timeout and eh_deadline
> 
> We were having double completions on our SLI-3 version of adapters.
> Solved by clearing our command pointer before calling scsi_done.
> 
> The eh paths potentially ran simulatenously and would see the non-null
> value and invoke scsi_done again.
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_scsi.c |  6 +++---
>  drivers/scsi/lpfc/lpfc_sli.c  | 12 
>  2 files changed, 11 insertions(+), 7 deletions(-)
> 
I think I've suggested a similar patch some time ago ...

Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 13/17] lpfc: Fix lost target in pt-to-pt connect

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Fix lost target in pt-to-pt connect
> 
> Change reject code to something that allows a retry
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_els.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 12/17] lpfc: Revise strings with full lpfc parameter name

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Revise strings with full lpfc parameter name
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_attr.c | 23 ---
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 16/17] lpfc: Fix fw download on SLI-4 FC adapters

2016-10-14 Thread Johannes Thumshirn
On Thu, Oct 13, 2016 at 03:06:17PM -0700, James Smart wrote:
> 
> Fix fw download on SLI-4 FC adapters
> 
> Driver performs a quick validation of magic numbers in the fw
> download image. Driver needed to be updated for more recent
> magic numbers.
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> ---
> v3 mods:
>  code cleanup: parsing image header fields

Thanks,
Reviewed-by: Johannes Thumshirn 

-- 
Johannes Thumshirn  Storage
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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: [GIT PULL] final round of SCSI updates for the 4.8+ merge window

2016-10-14 Thread Finn Thain

On Fri, 14 Oct 2016, James Bottomley wrote:

> This is just a set of minor updates and fixes which weren't quite ready
> in time for the first pull request.  The only real thing of note is
> Mike Christie is stepping down as Maintainer of iscsi to be replaced by
> Lee Duncan and Chris Leech.
> 
> The patch is available here:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-misc
> 
> The short changelog is:
> 
> Baoyou Xie (1):
>   scsi: be2iscsi: mark symbols static where possible
> 
> Joao Pinto (1):
>   scsi: ufs: Kconfig fix
> 
> Kyuho Choi (1):
>   scsi: ufs: Enable no vccq quirk for skhynix device
> 
> Lee Duncan (1):
>   MAINTAINERS: Update open-iscsi maintainers
> 
> Ondrej Zary (3):
>   scsi: g_NCR5380: Stop using scsi_module.c

I believe that patch introduces an .init.text section mismatch, that I 
failed to notice when I reviewed it. So you may want Arnd Bergmann's fix 
which is commit 8f087c089dae5 ("scsi: NCR5380: no longer mark irq probing 
as __init") in mkp-scsi/4.10/scsi-queue.

-- 

>   scsi: g_NCR5380: Reduce overrides[] from array to struct
>   scsi: g_NCR5380: Remove deprecated __setup
> 
> Varun Prakash (1):
>   scsi: cxgb4i: Set completion bit in work request
> 
> Wei Yongjun (1):
>   scsi: ufs: Fix error return code in ufshcd_init()
> 
> Zang Leigang (1):
>   scsi: ufs: Data Segment only needed for WRITE DESCRIPTOR
> 
> And the diffstat:
> 
> 
>  Documentation/scsi/g_NCR5380.txt   |  34 +-
>  MAINTAINERS|   6 +-
>  drivers/scsi/be2iscsi/be_main.c|  12 +-
>  drivers/scsi/cxgbi/cxgb4i/cxgb4i.c |   5 +
>  drivers/scsi/g_NCR5380.c   | 699 
> -
>  drivers/scsi/g_NCR5380.h   |   8 -
>  drivers/scsi/ufs/Kconfig   |   2 +-
>  drivers/scsi/ufs/ufs_quirks.h  |   2 +
>  drivers/scsi/ufs/ufshcd.c  |  10 +-
>  9 files changed, 345 insertions(+), 433 deletions(-)
> 
> James
> 
> --
> 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
> 
--
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 1/3] target: Re-add missing SCF_ACK_KREF assignment in v4.1.y

2016-10-14 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 

This patch fixes a regression in >= v4.1.y code where the original
SCF_ACK_KREF assignment in target_get_sess_cmd() was dropped upstream
in commit 054922bb, but the series for addressing TMR ABORT_TASK +
LUN_RESET with fabric session reinstatement in commit febe562c20 still
depends on this code in transport_cmd_finish_abort().

The regression manifests itself as a se_cmd->cmd_kref +1 leak, where
ABORT_TASK + LUN_RESET can hang indefinately for a specific I_T session
for drivers using SCF_ACK_KREF, resulting in hung kthreads.

This patch has been verified with v4.1.y code.

Reported-by: Vaibhav Tandon 
Tested-by: Vaibhav Tandon 
Cc: Vaibhav Tandon 
Cc: sta...@vger.kernel.org # 4.1+
Signed-off-by: Nicholas Bellinger 
---
 drivers/target/target_core_transport.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/target/target_core_transport.c 
b/drivers/target/target_core_transport.c
index 6094a6b..00ec464 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2547,8 +2547,10 @@ int target_get_sess_cmd(struct se_cmd *se_cmd, bool 
ack_kref)
 * fabric acknowledgement that requires two target_put_sess_cmd()
 * invocations before se_cmd descriptor release.
 */
-   if (ack_kref)
+   if (ack_kref) {
kref_get(_cmd->cmd_kref);
+   se_cmd->se_cmd_flags |= SCF_ACK_KREF;
+   }
 
spin_lock_irqsave(_sess->sess_cmd_lock, flags);
if (se_sess->sess_tearing_down) {
-- 
1.9.1

--
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 0/3] target: Bug-fixes for v4.9-rc1

2016-10-14 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 

Hi folks,

Here are three outstanding target bug-fixes encountered during
failure and longevity testing with v4.1.y code.

The patch #1 is a v4.1+ regression where the missing upstream
assignment of SCF_ACK_KREF results in se_cmd->cmd_kref leakage
during TMR ABORT_TASK + LUN_RESET with concurrent session
reinstatement. v4.0 and earlier code is not effected.

The latter two address long-standing EXTENDED_COPY status bugs,
that can result in ESX hosts failing VAAI BlockCopy operations.

Patch #2 adds COPY TARGET DEVICE NOT REACHABLE during 0xe4
target descriptor NAA IEEE 0x83 /sys/kernel/config/target/core/
device lookup failure, in order to signal local copy fallback
to host.

Patch #3 propigates up correct local copy I/O SCSI status
(eg: RESERVATION_CONFLICT) to host.

Please review.

--nab

Dinesh Israni (1):
  target: Don't override EXTENDED_COPY xcopy_pt_cmd SCSI status code

Nicholas Bellinger (2):
  target: Re-add missing SCF_ACK_KREF assignment in v4.1.y
  target: Make EXTENDED_COPY 0xe4 failure return COPY TARGET DEVICE NOT
REACHABLE

 drivers/target/target_core_transport.c | 11 ++-
 drivers/target/target_core_xcopy.c | 34 ++
 include/target/target_core_base.h  |  1 +
 3 files changed, 37 insertions(+), 9 deletions(-)

-- 
1.9.1

--
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 2/3] target: Make EXTENDED_COPY 0xe4 failure return COPY TARGET DEVICE NOT REACHABLE

2016-10-14 Thread Nicholas A. Bellinger
From: Nicholas Bellinger 

This patch addresses a bug where EXTENDED_COPY across multiple LUNs
results in a CHECK_CONDITION when the source + destination are not
located on the same physical node.

ESX Host environments expect sense COPY_ABORTED w/ COPY TARGET DEVICE
NOT REACHABLE to be returned when this occurs, in order to signal
fallback to local copy method.

As described in section 6.3.3 of spc4r22:

  "If it is not possible to complete processing of a segment because the
   copy manager is unable to establish communications with a copy target
   device, because the copy target device does not respond to INQUIRY,
   or because the data returned in response to INQUIRY indicates
   an unsupported logical unit, then the EXTENDED COPY command shall be
   terminated with CHECK CONDITION status, with the sense key set to
   COPY ABORTED, and the additional sense code set to COPY TARGET DEVICE
   NOT REACHABLE."

Tested on v4.1.y with ESX v5.5u2+ with BlockCopy across multiple nodes.

Reported-by: Nixon Vincent 
Tested-by: Nixon Vincent 
Cc: Nixon Vincent 
Tested-by: Dinesh Israni 
Signed-off-by: Dinesh Israni 
Cc: Dinesh Israni 
Cc: sta...@vger.kernel.org # 3.14+
Signed-off-by: Nicholas Bellinger 
---
 drivers/target/target_core_transport.c |  7 +++
 drivers/target/target_core_xcopy.c | 22 --
 include/target/target_core_base.h  |  1 +
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/drivers/target/target_core_transport.c 
b/drivers/target/target_core_transport.c
index 00ec464..000bc6d 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1706,6 +1706,7 @@ void transport_generic_request_failure(struct se_cmd *cmd,
case TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED:
case TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED:
case TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED:
+   case TCM_COPY_TARGET_DEVICE_NOT_REACHABLE:
break;
case TCM_OUT_OF_RESOURCES:
sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
@@ -2873,6 +2874,12 @@ static const struct sense_info sense_info_table[] = {
.ascq = 0x03, /* LOGICAL BLOCK REFERENCE TAG CHECK FAILED */
.add_sector_info = true,
},
+   [TCM_COPY_TARGET_DEVICE_NOT_REACHABLE] = {
+   .key = COPY_ABORTED,
+   .asc = 0x0d,
+   .ascq = 0x02, /* COPY TARGET DEVICE NOT REACHABLE */
+
+   },
[TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE] = {
/*
 * Returning ILLEGAL REQUEST would cause immediate IO errors on
diff --git a/drivers/target/target_core_xcopy.c 
b/drivers/target/target_core_xcopy.c
index 75cd854..f2a1443 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -104,7 +104,7 @@ static int target_xcopy_locate_se_dev_e4(struct se_cmd 
*se_cmd, struct xcopy_op
}
mutex_unlock(_device_mutex);
 
-   pr_err("Unable to locate 0xe4 descriptor for EXTENDED_COPY\n");
+   pr_debug_ratelimited("Unable to locate 0xe4 descriptor for 
EXTENDED_COPY\n");
return -EINVAL;
 }
 
@@ -185,7 +185,7 @@ static int target_xcopy_parse_tiddesc_e4(struct se_cmd 
*se_cmd, struct xcopy_op
 
 static int target_xcopy_parse_target_descriptors(struct se_cmd *se_cmd,
struct xcopy_op *xop, unsigned char *p,
-   unsigned short tdll)
+   unsigned short tdll, sense_reason_t *sense_ret)
 {
struct se_device *local_dev = se_cmd->se_dev;
unsigned char *desc = p;
@@ -193,6 +193,8 @@ static int target_xcopy_parse_target_descriptors(struct 
se_cmd *se_cmd,
unsigned short start = 0;
bool src = true;
 
+   *sense_ret = TCM_INVALID_PARAMETER_LIST;
+
if (offset != 0) {
pr_err("XCOPY target descriptor list length is not"
" multiple of %d\n", XCOPY_TARGET_DESC_LEN);
@@ -243,9 +245,16 @@ static int target_xcopy_parse_target_descriptors(struct 
se_cmd *se_cmd,
rc = target_xcopy_locate_se_dev_e4(se_cmd, xop, true);
else
rc = target_xcopy_locate_se_dev_e4(se_cmd, xop, false);
-
-   if (rc < 0)
+   /*
+* If a matching IEEE NAA 0x83 descriptor for the requested device
+* is not located on this node, return COPY_ABORTED with ASQ/ASQC
+* 0x0d/0x02 - COPY_TARGET_DEVICE_NOT_REACHABLE to request the
+* initiator to fall back to normal copy method.
+*/
+   if (rc < 0) {
+   *sense_ret = TCM_COPY_TARGET_DEVICE_NOT_REACHABLE;
goto out;
+   }
 
pr_debug("XCOPY TGT desc: Source dev: %p NAA IEEE WWN: 0x%16phN\n",
 xop->src_dev, 

[PATCH 3/3] target: Don't override EXTENDED_COPY xcopy_pt_cmd SCSI status code

2016-10-14 Thread Nicholas A. Bellinger
From: Dinesh Israni 

This patch addresses a bug where a local EXTENDED_COPY WRITE or READ
backend I/O request would always return SAM_STAT_CHECK_CONDITION,
even if underlying xcopy_pt_cmd->se_cmd generated a different
SCSI status code.

ESX host environments expect to hit SAM_STAT_RESERVATION_CONFLICT
for certain scenarios, and SAM_STAT_CHECK_CONDITION results in
non-retriable status for these cases.

Tested on v4.1.y with ESX v5.5u2+ with local IBLOCK backend copy.

Reported-by: Nixon Vincent 
Tested-by: Nixon Vincent 
Cc: Nixon Vincent 
Tested-by: Dinesh Israni 
Signed-off-by: Dinesh Israni 
Cc: Dinesh Israni 
Cc: sta...@vger.kernel.org # 3.14+
Signed-off-by: Nicholas Bellinger 
---
 drivers/target/target_core_xcopy.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/target/target_core_xcopy.c 
b/drivers/target/target_core_xcopy.c
index f2a1443..094a144 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -662,6 +662,7 @@ static int target_xcopy_read_source(
rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, [0],
remote_port, true);
if (rc < 0) {
+   ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
transport_generic_free_cmd(se_cmd, 0);
return rc;
}
@@ -673,6 +674,7 @@ static int target_xcopy_read_source(
 
rc = target_xcopy_issue_pt_cmd(xpt_cmd);
if (rc < 0) {
+   ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
transport_generic_free_cmd(se_cmd, 0);
return rc;
}
@@ -723,6 +725,7 @@ static int target_xcopy_write_destination(
remote_port, false);
if (rc < 0) {
struct se_cmd *src_cmd = >src_pt_cmd->se_cmd;
+   ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
/*
 * If the failure happened before the t_mem_list hand-off in
 * target_xcopy_setup_pt_cmd(), Reset memory + clear flag so 
that
@@ -738,6 +741,7 @@ static int target_xcopy_write_destination(
 
rc = target_xcopy_issue_pt_cmd(xpt_cmd);
if (rc < 0) {
+   ec_cmd->scsi_status = xpt_cmd->se_cmd.scsi_status;
se_cmd->se_cmd_flags &= ~SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC;
transport_generic_free_cmd(se_cmd, 0);
return rc;
@@ -824,10 +828,14 @@ static void target_xcopy_do_work(struct work_struct *work)
 out:
xcopy_pt_undepend_remotedev(xop);
kfree(xop);
-
-   pr_warn_ratelimited("target_xcopy_do_work: rc: %d, Setting X-COPY 
CHECK_CONDITION"
-   " -> sending response\n", rc);
-   ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION;
+   /*
+* Don't override an error scsi status if it has already been set
+*/
+   if (ec_cmd->scsi_status == SAM_STAT_GOOD) {
+   pr_warn_ratelimited("target_xcopy_do_work: rc: %d, Setting 
X-COPY"
+   " CHECK_CONDITION -> sending response\n", rc);
+   ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION;
+   }
target_complete_cmd(ec_cmd, SAM_STAT_CHECK_CONDITION);
 }
 
-- 
1.9.1

--
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 v3 16/17] lpfc: Fix fw download on SLI-4 FC adapters

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> Fix fw download on SLI-4 FC adapters
> 
> Driver performs a quick validation of magic numbers in the fw
> download image. Driver needed to be updated for more recent
> magic numbers.
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> ---
> v3 mods:
>  code cleanup: parsing image header fields
> 
>  drivers/scsi/lpfc/lpfc_hw4.h  |  3 ++-
>  drivers/scsi/lpfc/lpfc_init.c | 20 +++-
>  2 files changed, 13 insertions(+), 10 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 v3 17/17] lpfc: lpfc version changed to 11.2.0.2

2016-10-14 Thread Hannes Reinecke
On 10/14/2016 12:06 AM, James Smart wrote:
> 
> lpfc version changed to 11.2.0.2
> 
> Signed-off-by: Dick Kennedy 
> Signed-off-by: James Smart 
> Reviewed-by: Johannes Thumshirn 
> ---
>  drivers/scsi/lpfc/lpfc_version.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_version.h 
> b/drivers/scsi/lpfc/lpfc_version.h
> index c9bf20e..50bfc43 100644
> --- a/drivers/scsi/lpfc/lpfc_version.h
> +++ b/drivers/scsi/lpfc/lpfc_version.h
> @@ -18,7 +18,7 @@
>   * included with this package. *
>   ***/
>  
> -#define LPFC_DRIVER_VERSION "11.2.0.0."
> +#define LPFC_DRIVER_VERSION "11.2.0.2"
>  #define LPFC_DRIVER_NAME "lpfc"
>  
>  /* Used for SLI 2/3 */
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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 V4 2/2] aacraid: remove wildcard for series 9 controllers

2016-10-14 Thread Don Brace

On 09/08/2016 01:25 PM, James Bottomley wrote:

On Thu, 2016-09-08 at 18:15 +, Don Brace wrote:

-{ 0x9005, 0x028f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 65 }, /*
Adaptec PMC
Series 9 */

How are people that load aacraid in their initrd going to boot
after
this?

--
Martin K. Petersen  Oracle Linux Engineering

I updated smartpqi/Kconfig and added
Documentation/scsi/smartpqi.txt to
inform users of the
need to configure the smartpqi driver moving forward for aacraid
Series 9
controllers.

Hope this helps.

That's not going to be enough: this ID has been in the aacriad driver
since 2011.  That means anyone who finally gets hold of one of these
new cards but uses a distro that doesn't have the new smartpqi driver
will be attached via the aacraid one.

Given that the life times of enterprise distributions is two years and
you're releasing this smartpqi soon, the overlap is unavoidable.

James


We can make sure that we mention the need to enable the smartpqi
driver in the documentation provided/posted for these new controllers
otherwise the aacraid driver will not be able to fully support the new
controller features.

Don

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


--
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: ufs: changing maintainer

2016-10-14 Thread Joao Pinto
I am going to leave Synopsys and so this patch changes the Maintainer
for UFS Synopsys' specific drivers to my colleagues Manjunath and Prabu.

Signed-off-by: Joao Pinto 
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5ac91d8a..d9855b5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12084,7 +12084,8 @@ F:  Documentation/scsi/ufs.txt
 F: drivers/scsi/ufs/
 
 UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER DWC HOOKS
-M: Joao Pinto 
+M: Manjunath M Bettegowda 
+M: Prabu Thangamuthu 
 L: linux-scsi@vger.kernel.org
 S: Supported
 F: drivers/scsi/ufs/*dwc*
-- 
1.8.1.5

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


[bug report] smartpqi: initial commit of Microsemi smartpqi driver

2016-10-14 Thread Dan Carpenter
Hello Kevin Barnett,

The patch 6c223761eb54: "smartpqi: initial commit of Microsemi
smartpqi driver" from Jun 27, 2016, leads to the following static
checker warning:

drivers/scsi/smartpqi/smartpqi_init.c:3513 
pqi_submit_raid_request_synchronous()
warn: inconsistent returns 'sem:_info->sync_request_sem'.

drivers/scsi/smartpqi/smartpqi_init.c
  3437  static int pqi_submit_raid_request_synchronous(struct pqi_ctrl_info 
*ctrl_info,
  3438  struct pqi_iu_header *request, unsigned int flags,
  3439  struct pqi_raid_error_info *error_info, unsigned long 
timeout_msecs)
  3440  {
  3441  int rc;
  3442  struct pqi_io_request *io_request;
  3443  unsigned long start_jiffies;
  3444  unsigned long msecs_blocked;
  3445  size_t iu_length;
  3446  
  3447  /*
  3448   * Note that specifying PQI_SYNC_FLAGS_INTERRUPTABLE and a 
timeout value
  3449   * are mutually exclusive.
  3450   */
  3451  
  3452  if (flags & PQI_SYNC_FLAGS_INTERRUPTABLE) {
  3453  if (down_interruptible(_info->sync_request_sem))
  3454  return -ERESTARTSYS;
  3455  } else {
  3456  if (timeout_msecs == NO_TIMEOUT) {
  3457  down(_info->sync_request_sem);
  3458  } else {
  3459  start_jiffies = jiffies;
  3460  if (down_timeout(_info->sync_request_sem,
  3461  msecs_to_jiffies(timeout_msecs)))
  3462  return -ETIMEDOUT;
  3463  msecs_blocked =
  3464  jiffies_to_msecs(jiffies - 
start_jiffies);
  3465  if (msecs_blocked >= timeout_msecs)
  3466  return -ETIMEDOUT;

You probably just want to delete this if statement because it is racy.
Or unlock before returning at any rate.

  3467  timeout_msecs -= msecs_blocked;
  3468  }
  3469  }

regards,
dan carpenter
--
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: aic7xxx: fix ahc_delay and ahd_delay

2016-10-14 Thread Denys Vlasenko
They are buggy:

while (usec > 0)
   udelay(usec % 1024);
   usec -= 1024;

For example, for usec = 100*1024 + 1, old code will udelay(1) 101 times,
i.e. it will be approximately equivalent to udelay(101),
not the expected udelay(102400).

This did not bite because all callers use values far from "pathological" ones,
such as 500 and 1000 - these work fine with buggy code.

This was reported in 2006 but was missed.

Signed-off-by: Denys Vlasenko 
CC: James Bottomley 
CC: Hannes Reinicke 
CC: linux-scsi@vger.kernel.org
CC: linux-ker...@vger.kernel.org
---
 drivers/scsi/aic7xxx/aic79xx_osm.c | 7 ---
 drivers/scsi/aic7xxx/aic7xxx_osm.c | 7 ---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c 
b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 2588b8f..e7a7838 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -380,9 +380,10 @@ ahd_delay(long usec)
 * multi-millisecond waits.  Wait at most
 * 1024us per call.
 */
-   while (usec > 0) {
-   udelay(usec % 1024);
-   usec -= 1024;
+   udelay(usec & 1023);
+   usec >>= 10;
+   while (--usec >= 0) {
+   udelay(1024);
}
 }
 
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c 
b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index fc6a831..c81798e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -388,9 +388,10 @@ ahc_delay(long usec)
 * multi-millisecond waits.  Wait at most
 * 1024us per call.
 */
-   while (usec > 0) {
-   udelay(usec % 1024);
-   usec -= 1024;
+   udelay(usec & 1023);
+   usec >>= 10;
+   while (--usec >= 0) {
+   udelay(1024);
}
 }
 
-- 
2.9.2

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


[GIT PULL] final round of SCSI updates for the 4.8+ merge window

2016-10-14 Thread James Bottomley
This is just a set of minor updates and fixes which weren't quite ready
in time for the first pull request.  The only real thing of note is
Mike Christie is stepping down as Maintainer of iscsi to be replaced by
Lee Duncan and Chris Leech.

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-misc

The short changelog is:

Baoyou Xie (1):
  scsi: be2iscsi: mark symbols static where possible

Joao Pinto (1):
  scsi: ufs: Kconfig fix

Kyuho Choi (1):
  scsi: ufs: Enable no vccq quirk for skhynix device

Lee Duncan (1):
  MAINTAINERS: Update open-iscsi maintainers

Ondrej Zary (3):
  scsi: g_NCR5380: Stop using scsi_module.c
  scsi: g_NCR5380: Reduce overrides[] from array to struct
  scsi: g_NCR5380: Remove deprecated __setup

Varun Prakash (1):
  scsi: cxgb4i: Set completion bit in work request

Wei Yongjun (1):
  scsi: ufs: Fix error return code in ufshcd_init()

Zang Leigang (1):
  scsi: ufs: Data Segment only needed for WRITE DESCRIPTOR

And the diffstat:


 Documentation/scsi/g_NCR5380.txt   |  34 +-
 MAINTAINERS|   6 +-
 drivers/scsi/be2iscsi/be_main.c|  12 +-
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c |   5 +
 drivers/scsi/g_NCR5380.c   | 699 -
 drivers/scsi/g_NCR5380.h   |   8 -
 drivers/scsi/ufs/Kconfig   |   2 +-
 drivers/scsi/ufs/ufs_quirks.h  |   2 +
 drivers/scsi/ufs/ufshcd.c  |  10 +-
 9 files changed, 345 insertions(+), 433 deletions(-)

James

--
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 v4 1/4] block: Add iocontext priority to request

2016-10-14 Thread Adam Manzananares
The 10/14/2016 07:54, Hannes Reinecke wrote:
> On 10/13/2016 09:53 PM, Adam Manzanares wrote:
> > Patch adds an association between iocontext ioprio and the ioprio of a
> > request. This value is set in blk_rq_set_prio which takes the request and
> > the ioc as arguments. If the ioc is valid in blk_rq_set_prio then the
> > iopriority of the request is set as the iopriority of the ioc. In
> > init_request_from_bio a check is made to see if the ioprio of the bio is
> > valid and if so then the request prio comes from the bio.
> > 
> > Signed-off-by: Adam Manzananares 
> > ---
> >  block/blk-core.c   |  4 +++-
> >  include/linux/blkdev.h | 14 ++
> >  2 files changed, 17 insertions(+), 1 deletion(-)
> > 
> > diff --git a/block/blk-core.c b/block/blk-core.c
> > index 14d7c07..361b1b9 100644
> > --- a/block/blk-core.c
> > +++ b/block/blk-core.c
> > @@ -1153,6 +1153,7 @@ static struct request *__get_request(struct 
> > request_list *rl, int op,
> >  
> > blk_rq_init(q, rq);
> > blk_rq_set_rl(rq, rl);
> > +   blk_rq_set_prio(rq, ioc);
> > req_set_op_attrs(rq, op, op_flags | REQ_ALLOCED);
> >  
> > /* init elvpriv */
> > @@ -1656,7 +1657,8 @@ void init_request_from_bio(struct request *req, 
> > struct bio *bio)
> >  
> > req->errors = 0;
> > req->__sector = bio->bi_iter.bi_sector;
> > -   req->ioprio = bio_prio(bio);
> > +   if (ioprio_valid(bio_prio(bio)))
> > +   req->ioprio = bio_prio(bio);
> > blk_rq_bio_prep(req->q, req, bio);
> >  }
> >  
> > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> > index c47c358..9a0ceaa 100644
> > --- a/include/linux/blkdev.h
> > +++ b/include/linux/blkdev.h
> > @@ -934,6 +934,20 @@ static inline unsigned int blk_rq_count_bios(struct 
> > request *rq)
> >  }
> >  
> >  /*
> > + * blk_rq_set_prio - associate a request with prio from ioc
> > + * @rq: request of interest
> > + * @ioc: target iocontext
> > + *
> > + * Assocate request prio with ioc prio so request based drivers
> > + * can leverage priority information.
> > + */
> > +static inline void blk_rq_set_prio(struct request *rq, struct io_context 
> > *ioc)
> > +{
> > +   if (ioc)
> > +   rq->ioprio = ioc->ioprio;
> > +}
> > +
> > +/*
> >   * Request issue related functions.
> >   */
> >  extern struct request *blk_peek_request(struct request_queue *q);
> > 
> Don't you need to check for 'ioprio_valid()' here, too?

I poked around and it should be safe to not check for ioprio valid
at this point. ioprio_valid only checks to see if the ioprio is 
not IOPRIO_CLASS_NONE. The request by default has a ioprio of none
so if the ioc has ioprio of none we are not changing anything. 

The locations in the code that I found where the ioc prio is set are 
either filtered through the syscall handler, which checks for invalid 
priority combinations, or have valid priority values. 

Take care,
Adam

> 
> Cheers,
> 
> Hannes
> -- 
> Dr. Hannes Reinecke  Teamlead Storage & Networking
> h...@suse.de +49 911 74053 688
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
> HRB 21284 (AG Nürnberg)
--
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 v5 2/4] fusion: remove iopriority handling

2016-10-14 Thread Adam Manzanares
Th 10/13/2016 22:34, Christoph Hellwig wrote:
> > Style wise you can further remove the extra parens around
> >   SCpnt->device->tagged_supported
> > As well as the now redundant braces.
> 
> I did send a patch looking just like that earlier :)

I'll remove the patch from the patchset. I must have missed the patch 
you are referencing.

Take care,
Adam
--
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