diff options
author | Arkadi Sharshevsky <arkadis@mellanox.com> | 2018-02-26 10:59:53 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-27 10:53:02 -0500 |
commit | b9d17175aeb984eba10d98b623b92488e9c8ece0 (patch) | |
tree | 248a68b02965c1a0772c56e522bab9e24f6e4342 /net | |
parent | 4c27bf3c5b7434ccb9ab962301da661c26b467a4 (diff) | |
download | linux-b9d17175aeb984eba10d98b623b92488e9c8ece0.tar.gz linux-b9d17175aeb984eba10d98b623b92488e9c8ece0.tar.bz2 linux-b9d17175aeb984eba10d98b623b92488e9c8ece0.zip |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/devlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c index 18d385ed8237..92aad7c46383 100644 --- a/net/core/devlink.c +++ b/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) 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; |