Skip to content

Commit

Permalink
devlink: Compare to size_new in case of resource child validation
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Yuval Mintz <[email protected]>
Signed-off-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Arkadi Sharshevsky authored and davem330 committed Feb 27, 2018
1 parent 4c27bf3 commit b9d1717
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/devlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b9d1717

Please sign in to comment.