When creating new namespace make sure DPA address are properly aligned based
on arch restrictions.

Signed-off-by: Aneesh Kumar K.V <[email protected]>
---
 drivers/nvdimm/namespace_devs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 06b55c41660d..6a83db9f8734 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -589,6 +589,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;
-- 
2.23.0
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to