From 34a632a04ed67872c680d456640003bbeb51cdef Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Mon, 19 Oct 2020 14:23:12 +0200 Subject: [PATCH] lib: drop generic sense data descriptor VALID check According to SPC-5 (r17), the sense data descriptor format follows: byte field ---- ----- 0: DESCRIPTOR TYPE 1: ADDITIONAL LENGTH 2-n: Sense data descriptor specific The VALID bit is a sense data descriptor specific flag, and is not present in the only sense data descriptor supported by libiscsi - Sense key specific sense data descriptors. Drop the generic VALID bit check, in preparation for handling it on a sense data descriptor specific basis. Suggested-by: Bart Van Assche Signed-off-by: David Disseldorp --- lib/iscsi-command.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/iscsi-command.c b/lib/iscsi-command.c index ef6337e..ba4bc44 100644 --- a/lib/iscsi-command.c +++ b/lib/iscsi-command.c @@ -328,8 +328,6 @@ static void parse_sense_descriptors(struct scsi_sense *sense, const uint8_t *sb, for (p = sb; p < end; p += p[1]) { if (p[1] < 4) /* length */ break; - if (!(p[2] & 0x80)) /* VALID bit */ - break; switch (p[0]) { case 2: /* Sense key specific sense data descriptor */