]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sed-opal: ignore locking ranges array when not enabling SUM.
authorOndrej Kozina <okozina@redhat.com>
Fri, 30 Jan 2026 16:33:52 +0000 (17:33 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Feb 2026 14:04:43 +0000 (07:04 -0700)
The locking ranges count and the array items are always ignored unless
Single User Mode (SUM) is requested in the activate method.

It is useless to enforce limits of unused array in the non-SUM case.

Signed-off-by: Ondrej Kozina <okozina@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/sed-opal.c

index 5a28f23f7f22c8966684dcc43fb07a45c0d9d134..23a19c92d7912a3c78139f1f8f734f7255cb44f6 100644 (file)
@@ -2940,7 +2940,8 @@ static int opal_activate_lsp(struct opal_dev *dev,
        };
        int ret;
 
-       if (!opal_lr_act->num_lrs || opal_lr_act->num_lrs > OPAL_MAX_LRS)
+       if (opal_lr_act->sum &&
+           (!opal_lr_act->num_lrs || opal_lr_act->num_lrs > OPAL_MAX_LRS))
                return -EINVAL;
 
        ret = opal_get_key(dev, &opal_lr_act->key);