Commit 06564bae authored by Ondrej Kozina's avatar Ondrej Kozina Committed by Jens Axboe
Browse files

sed-opal: ignore locking ranges array when not enabling SUM.



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: default avatarOndrej Kozina <okozina@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 229f4125
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);