Skip to contentSkip to conversation

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

PATCH In review Ira Weiny 2 participants 2 messages Sep 27, 2023 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 1/1 ndctl/cxl/region: Report max size for region creation

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.

---
 cxl/region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cxl/region.c +2 -2
index bcd703956207..cb6a547990fb 100644
@@ -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,

Signature · 1 line
Ira Weiny <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ira Weiny

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.

Quoted 25 lines
---
 cxl/region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cxl/region.c +2 -3
index bcd703956207..cb6a547990fb 100644
@@ -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,