Skip to contentSkip to conversation

devlink: Compare to size_new in case of resource child validation

PATCH Applied Jiri Pirko 2 participants 2 messages Feb 26, 2018 – Feb 27, 2018

Subsystems (2)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 devlink: Compare to size_new in case of resource child validation

From: Arkadi Sharshevsky <[email protected]>

The current implementation checks the combined size of the children with the 'size' of the parent. The correct behavior is to check the combined size vs the pending change and to compare vs the 'size_new'.

Fixes d9f9b9a4d05f ("devlink: Add support for resource abstraction")
---
 net/core/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/devlink.c +1 -1
index 18d385ed8237..92aad7c46383 100644
@@ -2332,7 +2332,7 @@ devlink_resource_validate_children(struct devlink_resource *resource)
 	list_for_each_entry(child_resource, &resource->resource_list, list)
 		parts_size += child_resource->size_new;
 
-	if (parts_size > resource->size)
+	if (parts_size > resource->size_new)
 		size_valid = false;
 out:
 	resource->size_valid = size_valid;
Signature · 1 line
2.14.3
maintainer Applied
#1 lore raw

From: Jiri Pirko <[email protected]>
Date: Mon, 26 Feb 2018 10:59:53 +0100

Quoted 10 lines

From: Arkadi Sharshevsky <[email protected]>

The current implementation checks the combined size of the children with the 'size' of the parent. The correct behavior is to check the combined size vs the pending change and to compare vs the 'size_new'.

Fixes d9f9b9a4d05f ("devlink: Add support for resource abstraction")

Applied, thank you.