]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
block: add IOC_PR_READ_RESERVATION ioctl
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 1 Dec 2025 21:43:29 +0000 (16:43 -0500)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Dec 2025 14:19:26 +0000 (07:19 -0700)
commit3e2cb9ee76c27f57bfdb7b4753b909594d4fa31a
tree3deb83b6d971b7feab57ddf32b7a856e439ccb95
parent22a1ffea5f805dfa21b64d1c7b5fe39c0c78c997
block: add IOC_PR_READ_RESERVATION ioctl

Add a Persistent Reservations ioctl to read the current reservation.
This calls the pr_ops->read_reservation() function that was previously
added in commit c787f1baa503 ("block: Add PR callouts for read keys and
reservation") but was only used by the in-kernel SCSI target so far.

The IOC_PR_READ_RESERVATION ioctl is necessary so that userspace
applications that rely on Persistent Reservations ioctls have a way of
inspecting the current state. Cluster managers and validation tests need
this functionality.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/ioctl.c
include/uapi/linux/pr.h