Repository navigation
fix(nvmf): increment reservation generation per command - #94
Draft
davidcheng0922 wants to merge 1 commit into
Draft
davidcheng0922 wants to merge 1 commit into
davidcheng0922 wants to merge 1 commit into
Conversation
davidcheng0922
marked this pull request as draft
November 16, 2026 06:20
The NVMe Base Specification (Reservation Status data structure, GEN field) defines the generation as a counter incremented once each time a Reservation Register command, a Reservation Release command with Clear, or a Reservation Acquire command with Preempt or Preempt and Abort completes successfully. The generation was instead incremented each time a registrant was added or removed. A Replace, a register with the current key, or a preempt that removed no registrant did not increment it, and a preempt or clear that removed several registrants incremented it several times. Increment the generation once when each of those commands completes successfully, and no longer when a registrant is added or removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Change-Id: I2d04db67ac183d152d6978673e6b423265eca35e Signed-off-by: David Cheng <david.cheng@suse.com>
davidcheng0922
force-pushed
the
issue-14274-shared-rwx-block-reservation
branch
from
November 20, 2026 04:59
6a4d51f to
0b5c9e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue(s) this PR fixes:
longhorn/longhorn#14274
What this PR does / why we need it:
According to the NVMe Base Specification 2.1 Figure 581: Reservation Status Data Structure, the Generation (GEN) field is a 32-bit wrapping counter that is incremented once each time one of the following commands completes successfully:
SPDK incremented GEN once per registrant added or removed, in
nvmf_ns_reservation_add_registrant()andnvmf_ns_reservation_remove_registrant(). So a Replace or a self-preempt did not increment it, and a Preempt or Clear that removed N registrants incremented it N times.This change increments GEN once per successful Register, Release with Clear, and Acquire with Preempt or Preempt and Abort command, and updates the unit tests.
This is a minor bug. GEN is informational, and only matters to applications that compare it across reports to detect changes, such as SCSI Persistent Reservation translation (PRgeneration). Reservation enforcement and I/O are not affected.
Special notes for your reviewer:
Additional documentation or context