Skip to content

Commit

Permalink
devlink: use -ENOSPC to indicate no more room for snapshots
Browse files Browse the repository at this point in the history
The devlink_region_snapshot_create function returns -ENOMEM when the
maximum number of snapshots has been reached. This is confusing because
it is not an issue of being out of memory. Change this to use -ENOSPC
instead.

Reported-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jacob Keller authored and David S. Miller committed Mar 27, 2020
1 parent cf80fae commit 47a39f6
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 @@ -3793,7 +3793,7 @@ __devlink_region_snapshot_create(struct devlink_region *region,

/* check if region can hold one more snapshot */
if (region->cur_snapshots == region->max_snapshots)
return -ENOMEM;
return -ENOSPC;

if (devlink_region_snapshot_get_by_id(region, snapshot_id))
return -EEXIST;
Expand Down

0 comments on commit 47a39f6

Please sign in to comment.