Commit 47a39f61 authored by Jacob Keller's avatar Jacob Keller Committed by David S. Miller

devlink: use -ENOSPC to indicate no more room for snapshots

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: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cf80faee
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment