sed-opal: add IOC_OPAL_LR_SET_START_LEN ioctl.
authorOndrej Kozina <okozina@redhat.com>
Fri, 6 Feb 2026 14:18:00 +0000 (15:18 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Mar 2026 20:29:59 +0000 (14:29 -0600)
commit8e3d34a7ce7386b01947dd649bd24775544e4d3e
tree2fa1b555e248a058b5f2cfb5dee9e2b20e502dbe
parent8ff71e6b961beea2ab25850b285287a3350bce92
sed-opal: add IOC_OPAL_LR_SET_START_LEN ioctl.

This ioctl is used to set up locking range start (offset)
and locking range length attributes only.

In Single User Mode (SUM), if the RangeStartRangeLengthPolicy parameter
is set in the 'Reactivate' method, only Admin authority maintains the
locking range length and start (offset) attributes of Locking objects
set up for SUM. All other attributes from struct opal_user_lr_setup
(RLE - read locking enabled, WLE - write locking enabled) shall
remain in possession of the User authority associated with the Locking
object set for SUM.

Therefore, we need a separate function for setting up locking range
start and locking range length because it may require two different
authorities (and sessions) if the RangeStartRangeLengthPolicy attribute
is set.

With the IOC_OPAL_LR_SET_START_LEN ioctl, the opal_user_lr_setup
members 'RLE' and 'WLE' of the ioctl argument are ignored.

Signed-off-by: Ondrej Kozina <okozina@redhat.com>
Reviewed-and-tested-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/sed-opal.c
include/linux/sed-opal.h
include/uapi/linux/sed-opal.h