fix reregister to check for resvn conflict
According to SPC, an attempt to register on a registeried I_T Nexus with the incorrect reservation key should produce a reservation conflict.
This commit is contained in:
committed by
Ronnie Sahlberg
parent
cfc83f0b4f
commit
510883f28f
@@ -690,22 +690,13 @@ prout_reregister_key_fails(struct iscsi_context *iscsi, int lun,
|
||||
iscsi_get_error(iscsi));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (task->status != SCSI_STATUS_CHECK_CONDITION ||
|
||||
task->sense.key != SCSI_SENSE_ILLEGAL_REQUEST ||
|
||||
task->sense.ascq != SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
|
||||
|
||||
if (task->status != SCSI_STATUS_RESERVATION_CONFLICT) {
|
||||
logging(LOG_NORMAL,
|
||||
"[FAILED] PROUT/REGISTER when already registered should fail");
|
||||
ret = -1;
|
||||
goto dun;
|
||||
}
|
||||
if (task->status == SCSI_STATUS_GOOD) {
|
||||
logging(LOG_NORMAL,
|
||||
"[FAILED] PROUT/REGISTER command: succeeded when it should not have");
|
||||
"[FAILED] Expected RESERVATION CONFLICT");
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
dun:
|
||||
scsi_free_scsi_task(task);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user