diff mbox series

[RFC,ndctl,8/9] test/multi-pmem: fix for no-interleave support

Message ID 20201007042256.1110626-8-santosh@fossix.org (mailing list archive)
State New, archived
Headers show
Series [RFC,ndctl,1/9] libndctl: test enablement for non-nfit devices | expand

Commit Message

Santosh Sivaraj Oct. 7, 2020, 4:22 a.m. UTC
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
---
 test/multi-pmem.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/test/multi-pmem.c b/test/multi-pmem.c
index 668662c..ef4fec0 100644
--- a/test/multi-pmem.c
+++ b/test/multi-pmem.c
@@ -208,6 +208,14 @@  static int do_multi_pmem(struct ndctl_ctx *ctx, struct ndctl_test *test)
 			break;
 	}
 
+	/* FIXME: the above expects the a blk region to be available on the
+	 * previously identified dimm, which won't if we don't have interleaved
+	 * support
+	 */
+
+	if (!region)
+		goto no_interleave;
+
 	blk_avail_orig = ndctl_region_get_available_size(region);
 	for (i = 1; i < NUM_NAMESPACES - 1; i++) {
 		ndns = namespaces[i];
@@ -239,6 +247,7 @@  static int do_multi_pmem(struct ndctl_ctx *ctx, struct ndctl_test *test)
 	if (check_deleted(target, devname, test) != 0)
 		return -ENXIO;
 
+no_interleave:
 	ndctl_bus_foreach(ctx, bus) {
 		if (strncmp(ndctl_bus_get_provider(bus), "nfit_test", 9) != 0)
 			continue;