Skip to content
Commit 274b9240 authored by Jeff Moyer's avatar Jeff Moyer Committed by Dan Williams
Browse files

libnvdimm/pfn: Fix namespace creation on misaligned addresses

Yi reported[1] that after commit a3619190 ("libnvdimm/pfn: stop
padding pmem namespaces to section alignment"), it was no longer
possible to create a device dax namespace with a 1G alignment.  The
reason was that the pmem region was not itself 1G-aligned.  The code
happily skips past the first 512M, but fails to account for a now
misaligned end offset (since space was allocated starting at that
misaligned address, and extending for size GBs).  Reintroduce
end_trunc, so that the code correctly handles the misaligned end
address.  This results in the same behavior as before the introduction
of the offending commit.

[1] https://lists.01.org/pipermail/linux-nvdimm/2019-July/022813.html



Fixes: a3619190 ("libnvdimm/pfn: stop padding pmem namespaces ...")
Reported-and-tested-by: default avatarYi Zhang <yi.zhang@redhat.com>
Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
Link: https://lore.kernel.org/r/x49ftll8f39.fsf@segfault.boston.devel.redhat.com


Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent a55aa89a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment