Skip to content

Commit b9d1717

Browse files
Arkadi Sharshevskydavem330
authored andcommitted
devlink: Compare to size_new in case of resource child validation
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: d9f9b9a ("devlink: Add support for resource abstraction") Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Tested-by: Yuval Mintz <yuvalm@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4c27bf3 commit b9d1717

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/devlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ devlink_resource_validate_children(struct devlink_resource *resource)
23322332
list_for_each_entry(child_resource, &resource->resource_list, list)
23332333
parts_size += child_resource->size_new;
23342334

2335-
if (parts_size > resource->size)
2335+
if (parts_size > resource->size_new)
23362336
size_valid = false;
23372337
out:
23382338
resource->size_valid = size_valid;

0 commit comments

Comments
 (0)