diff mbox

[2/5] ipr: Clear NO_ULEN_CHK bit when resource is a vset.

Message ID 1446223749-17416-2-git-send-email-krisman@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Gabriel Krisman Bertazi Oct. 30, 2015, 4:49 p.m. UTC
According to the IPR specification, Inhibit Underlength Checking bit
must be disabled when sending commands to vsets.  Enabling this bit for
vset might cause SCSI commands to fail with an Illegal Request.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
---
 drivers/scsi/ipr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Manoj Kumar Oct. 30, 2015, 5:52 p.m. UTC | #1
On 10/30/2015 11:49 AM, Gabriel Krisman Bertazi wrote:
>
>   	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
> -		if (scsi_cmd->underflow == 0)
> +		if (scsi_cmd->underflow == 0 && !ipr_is_vset_device(res))

This section is getting quite convoluted. If there isn't really that
much common between ipr_is_gscsi(res) and ipr_is_vset_device(res)
anymore, it would read much better as distinct segments:

if (ipr_is_gscsi(res))
...
if (ipr_is_vset_devices(res))
...

This will avoid having multiple calls to ipr_is_gscsi() and
ipr_is_vset_device() in the same section of code.

---
Manoj Kumar

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 4034cd3..da957b3 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -6364,7 +6364,7 @@  static int ipr_queuecommand(struct Scsi_Host *shost,
 	ipr_cmd->done = ipr_scsi_eh_done;
 
 	if (ipr_is_gscsi(res) || ipr_is_vset_device(res)) {
-		if (scsi_cmd->underflow == 0)
+		if (scsi_cmd->underflow == 0 && !ipr_is_vset_device(res))
 			ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_ULEN_CHK;
 
 		ioarcb->cmd_pkt.flags_hi |= IPR_FLAGS_HI_NO_LINK_DESC;