linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH blktests] nvme/054: fix nvme reservation preempt and clear operations
@ 2025-08-22 15:00 Yi Zhang
  2025-08-25 17:17 ` Chaitanya Kulkarni
  2025-08-26 13:52 ` Shinichiro Kawasaki
  0 siblings, 2 replies; 3+ messages in thread
From: Yi Zhang @ 2025-08-22 15:00 UTC (permalink / raw)
  To: linux-nvme; +Cc: kanie, shinichiro.kawasaki, kch, dwagner

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: https://github.com/linux-blktests/blktests/issues/190
Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
---
 tests/nvme/054     | 3 +--
 tests/nvme/054.out | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/nvme/054 b/tests/nvme/054
index 0a9ac80..08e3a00 100755
--- a/tests/nvme/054
+++ b/tests/nvme/054
@@ -55,7 +55,7 @@ test_resv() {
 	resv_report "${test_dev}" "${report_arg}"
 
 	echo "Preempt"
-	nvme resv-acquire "${test_dev}" --crkey=4 --rtype=2 --racqa=1
+	nvme resv-acquire "${test_dev}" --crkey=4 --prkey=4 --rtype=2 --racqa=1
 	resv_report "${test_dev}" "${report_arg}"
 
 	echo "Release"
@@ -63,7 +63,6 @@ test_resv() {
 	resv_report "${test_dev}" "${report_arg}"
 
 	echo "Clear"
-	nvme resv-register "${test_dev}" --nrkey=4 --rrega=0
 	nvme resv-acquire "${test_dev}" --crkey=4 --rtype=1 --racqa=0
 	resv_report "${test_dev}" "${report_arg}"
 	nvme resv-release "${test_dev}" --crkey=4 --rrela=1
diff --git a/tests/nvme/054.out b/tests/nvme/054.out
index 5adb30d..9c92668 100644
--- a/tests/nvme/054.out
+++ b/tests/nvme/054.out
@@ -54,9 +54,8 @@ regctlext[0] :
   rcsts      : 0
   rkey       : 4
 Clear
-NVME Reservation  success
 NVME Reservation Acquire success
-gen       : 6
+gen       : 5
 rtype     : 1
 regctl    : 1
 regctlext[0] :
-- 
2.45.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests] nvme/054: fix nvme reservation preempt and clear operations
  2025-08-22 15:00 [PATCH blktests] nvme/054: fix nvme reservation preempt and clear operations Yi Zhang
@ 2025-08-25 17:17 ` Chaitanya Kulkarni
  2025-08-26 13:52 ` Shinichiro Kawasaki
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2025-08-25 17:17 UTC (permalink / raw)
  To: Yi Zhang, linux-nvme@lists.infradead.org
  Cc: kanie@linux.alibaba.com, shinichiro.kawasaki@wdc.com,
	Chaitanya Kulkarni, dwagner@suse.de

On 8/22/25 08:00, Yi Zhang wrote:
> 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:https://github.com/linux-blktests/blktests/issues/190
> Signed-off-by: Yi Zhang<yi.zhang@redhat.com>


Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH blktests] nvme/054: fix nvme reservation preempt and clear operations
  2025-08-22 15:00 [PATCH blktests] nvme/054: fix nvme reservation preempt and clear operations Yi Zhang
  2025-08-25 17:17 ` Chaitanya Kulkarni
@ 2025-08-26 13:52 ` Shinichiro Kawasaki
  1 sibling, 0 replies; 3+ messages in thread
From: Shinichiro Kawasaki @ 2025-08-26 13:52 UTC (permalink / raw)
  To: Yi Zhang
  Cc: linux-nvme@lists.infradead.org, kanie@linux.alibaba.com,
	kch@nvidia.com, dwagner@suse.de

On Aug 22, 2025 / 11:00, Yi Zhang wrote:
> 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: https://github.com/linux-blktests/blktests/issues/190
> Signed-off-by: Yi Zhang <yi.zhang@redhat.com>

FYI, I applied this patch. Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-26 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22 15:00 [PATCH blktests] nvme/054: fix nvme reservation preempt and clear operations Yi Zhang
2025-08-25 17:17 ` Chaitanya Kulkarni
2025-08-26 13:52 ` Shinichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).