Fix PERSISTENT RESERVE IN / READ RESERVATION response unmarshalling
The code that verifies the pr_type response must compare only the
lower four bits of byte 21 of the response ("TYPE") and must ignore
the upper four bits ("SCOPE").
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
0577fa9d66
commit
9dce01bbea
@@ -803,6 +803,7 @@ struct scsi_persistent_reserve_in_read_reservation {
|
|||||||
int reserved;
|
int reserved;
|
||||||
|
|
||||||
uint64_t reservation_key;
|
uint64_t reservation_key;
|
||||||
|
unsigned char pr_scope;
|
||||||
unsigned char pr_type;
|
unsigned char pr_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -815,7 +815,8 @@ scsi_persistentreservein_datain_unmarshall(struct scsi_task *task)
|
|||||||
rr->reserved = 1;
|
rr->reserved = 1;
|
||||||
rr->reservation_key =
|
rr->reservation_key =
|
||||||
task_get_uint64(task, 8);
|
task_get_uint64(task, 8);
|
||||||
rr->pr_type = task_get_uint8(task, 21) & 0xff;
|
rr->pr_scope = task_get_uint8(task, 21) >> 4;
|
||||||
|
rr->pr_type = task_get_uint8(task, 21) & 0xf;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rr;
|
return rr;
|
||||||
|
|||||||
Reference in New Issue
Block a user