diff mbox series

[ndctl] ndctl/cxl/region: Report max size for region creation

Message ID 20230926-max-size-create-region-v1-1-d3555e91087c@intel.com
State New, archived
Headers show
Series [ndctl] ndctl/cxl/region: Report max size for region creation | expand

Commit Message

Ira Weiny Sept. 27, 2023, 12:24 a.m. UTC
When creating a region if the size exceeds the max an error is printed.
However, the max available space is not reported which makes it harder
to determine what is wrong.

Add the max size available to the output error.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 cxl/region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


---
base-commit: a871e6153b11fe63780b37cdcb1eb347b296095c
change-id: 20230926-max-size-create-region-1f57ff3bc53c

Best regards,

Comments

Dave Jiang Sept. 27, 2023, 2:39 p.m. UTC | #1
On 9/26/23 17:24, Ira Weiny wrote:
> When creating a region if the size exceeds the max an error is printed.
> However, the max available space is not reported which makes it harder
> to determine what is wrong.
> 
> Add the max size available to the output error.
> 
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  cxl/region.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/cxl/region.c b/cxl/region.c
> index bcd703956207..cb6a547990fb 100644
> --- a/cxl/region.c
> +++ b/cxl/region.c
> @@ -623,8 +623,8 @@ static int create_region(struct cxl_ctx *ctx, int *count,
>  	}
>  	if (!default_size && size > max_extent) {
>  		log_err(&rl,
> -			"%s: region size %#lx exceeds max available space\n",
> -			cxl_decoder_get_devname(p->root_decoder), size);
> +			"%s: region size %#lx exceeds max available space (%#lx)\n",
> +			cxl_decoder_get_devname(p->root_decoder), size, max_extent);
>  		return -ENOSPC;
>  	}
>  
> 
> ---
> base-commit: a871e6153b11fe63780b37cdcb1eb347b296095c
> change-id: 20230926-max-size-create-region-1f57ff3bc53c
> 
> Best regards,
diff mbox series

Patch

diff --git a/cxl/region.c b/cxl/region.c
index bcd703956207..cb6a547990fb 100644
--- a/cxl/region.c
+++ b/cxl/region.c
@@ -623,8 +623,8 @@  static int create_region(struct cxl_ctx *ctx, int *count,
 	}
 	if (!default_size && size > max_extent) {
 		log_err(&rl,
-			"%s: region size %#lx exceeds max available space\n",
-			cxl_decoder_get_devname(p->root_decoder), size);
+			"%s: region size %#lx exceeds max available space (%#lx)\n",
+			cxl_decoder_get_devname(p->root_decoder), size, max_extent);
 		return -ENOSPC;
 	}