diff mbox series

[v4,5/6] libnvdimm/namespace: Align DPA based on arch restrictions

Message ID 20200120140749.69549-6-aneesh.kumar@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series Validating namespace size and start address attributes. | expand

Commit Message

Aneesh Kumar K.V Jan. 20, 2020, 2:07 p.m. UTC
When creating new namespace make sure DPA address are properly aligned based
on arch restrictions.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 drivers/nvdimm/namespace_devs.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index e318566ae135..59169d914b86 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -563,6 +563,8 @@  static void space_valid(struct nd_region *nd_region, struct nvdimm_drvdata *ndd,
 		return;
 	}
 
+	valid->start = ALIGN(valid->start, arch_namespace_align_size());
+
 	/* allocation needs to be contiguous, so this is all or nothing */
 	if (resource_size(valid) < n)
 		goto invalid;