Commit bc6e91d1 authored by Kou Jiawei's avatar Kou Jiawei Committed by Jim Harris
Browse files

scsi/scsi_pr.c: fix incorrect Reservation Key in SCSI PR READ FULL STATUS



When SPDK acts as a SCSI target, after the host registers a persistent
reservation for a SCSI device (e.g., sg_persist --out --register
--param-sark=0x12345678 /dev/sdx),
querying the status of sdX using read full status (sg_persist -s
/dev/sdx) returns an incorrect rkey value: Key=0x7856341200000000.

Change-Id: I677d40a325ebf7e1ca380cbc72f1243d47e0e2ba
Signed-off-by: default avatarKou Jiawei <kou.jiawei@zte.com.cn>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26261


Reviewed-by: default avatarChangpeng Liu <changpeliu@tencent.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
parent 48da967d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ scsi_pr_in_read_full_status(struct spdk_scsi_task *task,
			break;
		}
		add_len += sizeof(*desc);
		desc->rkey = reg->rkey;
		to_be64(&desc->rkey, reg->rkey);
		if (all_regs || lun->reservation.holder == reg) {
			desc->r_holder = true;
			desc->type = lun->reservation.rtype;