summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2026-02-10 11:36:17 -0500
committerJens Axboe <axboe@kernel.dk>2026-02-11 10:36:54 -0700
commit5b88af7113feba2f0ae3402bb57cb5c94eea7dc3 (patch)
treef9efb98024d560a427e26d9713cdebf2d2a57292 /init
parent2ebc8d600fb907fa6b1e7095c0b6d84fc47e91ea (diff)
block: allow IOC_PR_READ_* ioctls with BLK_OPEN_READ
The recently added IOC_PR_READ_* ioctls require the same BLK_OPEN_WRITE permission as the older persistent reservation ioctls. This has the drawback that udev triggers when the file descriptor is closed, resulting in unnecessary activity like scanning partitions even though these read-only ioctls do not modify the device. Change IOC_PR_READ_KEYS and IOC_PR_READ_RESERVATION to require BLK_OPEN_READ. This prevents unnecessary activity every time `blkpr --read-keys` or `blkpr --read-reservation` is invoked by shell scripts, for example. It is safe to reduce the permission requirement from BLK_OPEN_WRITE to BLK_OPEN_READ since these two ioctls do not modify the persistent reservation state. Userspace cannot use the information fetched by these ioctls to make changes to the device unless it later opens the device with BLK_OPEN_WRITE. Fixes: 3e2cb9ee76c2 ("block: add IOC_PR_READ_RESERVATION ioctl") Fixes: 22a1ffea5f80 ("block: add IOC_PR_READ_KEYS ioctl") Cc: Christoph Hellwig <hch@lst.de> Cc: Martin Wilck <mwilck@suse.com> Cc: Benjamin Marzinski <bmarzins@redhat.com> Suggested-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions