[net-next,v3,05/11] devlink: use -ENOSPC to indicate no more room for snapshots
diff mbox series

Message ID 20200326183718.2384349-6-jacob.e.keller@intel.com
State Accepted
Delegated to: David Miller
Headers show
Series
  • implement DEVLINK_CMD_REGION_NEW
Related show

Commit Message

Jacob Keller March 26, 2020, 6:37 p.m. UTC
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>
---
Changes since v1:
* Introduced this patch

 net/core/devlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/net/core/devlink.c b/net/core/devlink.c
index 620e9d07ac85..8c2c4bc009bb 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -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;