Skip to contentSkip to conversation

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

PATCH Applied Ondrej Kozina 3 participants 3 messages Jan 30 – Feb 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 block/sed-opal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/sed-opal.c +2 -1
index 37746801479c..a26a94642d84 100644
@@ -2942,7 +2942,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);
Signature · 1 line
2.52.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ondrej Kozina

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.

Looks good:

maintainer Applied
#2 lore raw
In reply to Ondrej Kozina
Quoted 6 lines · Ondrej Kozina

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.

Applied, thanks!

[1/1] sed-opal: ignore locking ranges array when not enabling SUM.

      commit: 06564bae93d024e346c49304dfb4e2aaa68cf620

Best regards,

Signature · 1 line
Jens Axboe