From bdb90726eeb05b63c1681d0c9062abd0ae518f79 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Wed, 3 Jul 2019 04:15:11 -0400 Subject: [PATCH] scsi: fix error break when checking SCSI reservation We should return for the registrant case when the reservation holder exists. Change-Id: Ie3cf31554eafdad03294aef2eeb6eaef1536b8c3 Signed-off-by: Changpeng Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460305 Tested-by: SPDK CI Jenkins Reviewed-by: Liang Yan Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk --- lib/scsi/scsi_pr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/scsi/scsi_pr.c b/lib/scsi/scsi_pr.c index 36145b90b..569732a1c 100644 --- a/lib/scsi/scsi_pr.c +++ b/lib/scsi/scsi_pr.c @@ -789,7 +789,7 @@ spdk_scsi_pr_check(struct spdk_scsi_task *task) "is not registered, cdb 0x%x\n", cdb[0]); goto conflict; } - break; + return 0; case SPDK_SPC_PERSISTENT_RESERVE_OUT: action = cdb[1] & 0x1f; SPDK_DEBUGLOG(SPDK_LOG_SCSI, "CHECK: PR OUT action %u\n", action); @@ -802,7 +802,7 @@ spdk_scsi_pr_check(struct spdk_scsi_task *task) SPDK_ERRLOG("CHECK: PR OUT action %u\n", action); goto conflict; } - break; + return 0; case SPDK_SCSI_PR_OUT_REGISTER: case SPDK_SCSI_PR_OUT_REG_AND_IGNORE_KEY: return 0;