提交 b9d17175 编写于 作者: A Arkadi Sharshevsky 提交者: David S. Miller

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: d9f9b9a4 ("devlink: Add support for resource abstraction")
Signed-off-by: NArkadi Sharshevsky <arkadis@mellanox.com>
Tested-by: NYuval Mintz <yuvalm@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4c27bf3c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册