Skip to content

Commit 06564ba

Browse files
onikoaxboe
authored andcommitted
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: Ondrej Kozina <okozina@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 229f412 commit 06564ba

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

block/sed-opal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2940,7 +2940,8 @@ static int opal_activate_lsp(struct opal_dev *dev,
29402940
};
29412941
int ret;
29422942

2943-
if (!opal_lr_act->num_lrs || opal_lr_act->num_lrs > OPAL_MAX_LRS)
2943+
if (opal_lr_act->sum &&
2944+
(!opal_lr_act->num_lrs || opal_lr_act->num_lrs > OPAL_MAX_LRS))
29442945
return -EINVAL;
29452946

29462947
ret = opal_get_key(dev, &opal_lr_act->key);

0 commit comments

Comments
 (0)