Re: [PATCH 02/14] target: Add DIF CHECK_CONDITION ASC/ASCQexception cases

From: Nicholas A. Bellinger
Date: Fri Jan 10 2014 - 01:52:01 EST


On Thu, 2014-01-09 at 12:43 +0200, Sagi Grimberg wrote:
> On 1/8/2014 10:36 PM, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> >
> > This patch adds support for DIF related CHECK_CONDITION ASC/ASCQ
> > exception cases into transport_send_check_condition_and_sense().
> >
> > This includes:
> >
> > LOGICAL BLOCK GUARD CHECK FAILED
> > LOGICAL BLOCK APPLICATION TAG CHECK FAILED
> > LOGICAL BLOCK REFERENCE TAG CHECK FAILED
> >
> > that used by DIF TYPE1 and TYPE3 failure cases.
> >
> > Cc: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
> > Cc: Christoph Hellwig <hch@xxxxxx>
> > Cc: Hannes Reinecke <hare@xxxxxxx>
> > Cc: Sagi Grimberg <sagig@xxxxxxxxxxxx>
> > Cc: Or Gerlitz <ogerlitz@xxxxxxxxxxxx>
> > Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> > ---
> > drivers/target/target_core_transport.c | 30 ++++++++++++++++++++++++++++++
> > include/target/target_core_base.h | 3 +++
> > 2 files changed, 33 insertions(+)
> >
> > diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> > index 91953da..707ee17 100644
> > --- a/drivers/target/target_core_transport.c
> > +++ b/drivers/target/target_core_transport.c
> > @@ -2648,6 +2648,36 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd,
> > buffer[SPC_ASC_KEY_OFFSET] = 0x1d;
> > buffer[SPC_ASCQ_KEY_OFFSET] = 0x00;
> > break;
> > + case TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED:
> > + /* CURRENT ERROR */
> > + buffer[0] = 0x70;
> > + buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10;
> > + /* ILLEGAL REQUEST */
> > + buffer[SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
> > + /* LOGICAL BLOCK GUARD CHECK FAILED */
> > + buffer[SPC_ASC_KEY_OFFSET] = 0x10;
> > + buffer[SPC_ASCQ_KEY_OFFSET] = 0x01;
>
> You have Enums for ASCQs (TARGET_GUARD_CHECK_FAILED,
> TARGET_APPTAG_CHECK_FAILED, TARGET_REFTAG_CHECK_FAILED). either use them
> or loose them.

<nod>, dropping these extra definitions.

--nab

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/