Skip to content

Commit f939e6e

Browse files
yizhanglinuxkawasaki
authored andcommitted
nvme/054: fix nvme reservation preempt and clear operations
This patch fixes two issues in the NVMe reservation test: 1. Missing --prkey parameter for Preempt operation: According to the nvme-cli documentation, when using resv-acquire with --racqa=1 (Preempt), the --prkey parameter is required to specify which reservation key to preempt. Without this parameter, the command fails with "Invalid Field in Command" error on some NVMe controllers. 2. Redundant registration in Clear operation: After a reservation release with --rrela=0, the registration remains valid. The subsequent resv-register command attempts to register with the same key, causing a "Reservation Conflict" error. This redundant registration is unnecessary and should be removed. These issues were discovered during my nvme reservation test with the same steps on NetApp storage connected via NVMe/RDMA. Link: #190 Signed-off-by: Yi Zhang <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Shin'ichiro Kawasaki <[email protected]>
1 parent 2c26a5f commit f939e6e

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

tests/nvme/054

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,14 @@ test_resv() {
5555
resv_report "${test_dev}" "${report_arg}"
5656

5757
echo "Preempt"
58-
nvme resv-acquire "${test_dev}" --crkey=4 --rtype=2 --racqa=1
58+
nvme resv-acquire "${test_dev}" --crkey=4 --prkey=4 --rtype=2 --racqa=1
5959
resv_report "${test_dev}" "${report_arg}"
6060

6161
echo "Release"
6262
nvme resv-release "${test_dev}" --crkey=4 --rtype=2 --rrela=0
6363
resv_report "${test_dev}" "${report_arg}"
6464

6565
echo "Clear"
66-
nvme resv-register "${test_dev}" --nrkey=4 --rrega=0
6766
nvme resv-acquire "${test_dev}" --crkey=4 --rtype=1 --racqa=0
6867
resv_report "${test_dev}" "${report_arg}"
6968
nvme resv-release "${test_dev}" --crkey=4 --rrela=1

tests/nvme/054.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ regctlext[0] :
5454
rcsts : 0
5555
rkey : 4
5656
Clear
57-
NVME Reservation success
5857
NVME Reservation Acquire success
59-
gen : 6
58+
gen : 5
6059
rtype : 1
6160
regctl : 1
6261
regctlext[0] :

0 commit comments

Comments
 (0)