Re: Detected NON_EXISTENT_LUN Access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nick,

given the proven difficulty with conditional expressions, can we try
to make these as obvious and non-obfuscated as possible?

On Mon, 28 November 2011 15:03:39 -0800, Nicholas A. Bellinger wrote:
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index 364660d..5b61680 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -2043,16 +2043,16 @@ static int qla_tgt_pre_xmit_response(struct qla_tgt_cmd *cmd, struct qla_tgt_prm
>                 prm->residual = se_cmd->residual_count;
>                 ql_dbg(ql_dbg_tgt, vha, 0xe012, "Residual underflow: %d (tag %d, "
>                         "op %x, bufflen %d, rq_result %x)\n",
> -                       prm->residual, cmd->tag,
> -                       se_cmd->t_task_cdb[0], cmd->bufflen,
> +                       prm->residual, cmd->tag, (se_cmd->t_task_cdb != NULL) ?
> +                       se_cmd->t_task_cdb[0] : 0x00, cmd->bufflen,

+			prm->residual, cmd->tag,
+			se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0,
+			cmd->bufflen,

>                         prm->rq_result);
>                 prm->rq_result |= SS_RESIDUAL_UNDER;
>         } else if (se_cmd->se_cmd_flags & SCF_OVERFLOW_BIT) {
>                 prm->residual = se_cmd->residual_count;
>                 ql_dbg(ql_dbg_tgt, vha, 0xe013, "Residual overflow: %d (tag %d, "
>                         "op %x, bufflen %d, rq_result %x)\n",
> -                       prm->residual, cmd->tag,
> -                       se_cmd->t_task_cdb[0], cmd->bufflen,
> +                       prm->residual, cmd->tag, (se_cmd->t_task_cdb != NULL) ?
> +                       se_cmd->t_task_cdb[0] : 0x00, cmd->bufflen,

+			prm->residual, cmd->tag,
+			se_cmd->t_task_cdb ? se_cmd->t_task_cdb[0] : 0,
+			cmd->bufflen,

Something like that maybe?

Jörn

-- 
A defeated army first battles and then seeks victory.
-- Sun Tzu
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux