浏览代码

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: d9f9b9a4d05f ("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>
Arkadi Sharshevsky 7 年之前
父节点
当前提交
b9d17175ae
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/core/devlink.c

+ 1 - 1
net/core/devlink.c

@@ -2332,7 +2332,7 @@ devlink_resource_validate_children(struct devlink_resource *resource)
 	list_for_each_entry(child_resource, &resource->resource_list, list)
 	list_for_each_entry(child_resource, &resource->resource_list, list)
 		parts_size += child_resource->size_new;
 		parts_size += child_resource->size_new;
 
 
-	if (parts_size > resource->size)
+	if (parts_size > resource->size_new)
 		size_valid = false;
 		size_valid = false;
 out:
 out:
 	resource->size_valid = size_valid;
 	resource->size_valid = size_valid;