libnvdimm, pfn: fix start_pad handling for aligned namespaces
authorDan Williams <dan.j.williams@intel.com>
Tue, 19 Dec 2017 23:07:10 +0000 (15:07 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Dec 2017 16:53:49 +0000 (17:53 +0100)
commit01b1a29e32c13c69c0fd8a70e6cd66ac91316862
tree587c1f68c6ef4ad22b1578a454a3367bf082beb2
parent166f39bc340d0eb739d31ddd347df593d7b6ff97
libnvdimm, pfn: fix start_pad handling for aligned namespaces

commit 19deaa217bc04e83b59b5e8c8229eb0e53ad9efc upstream.

The alignment checks at pfn driver startup fail to properly account for
the 'start_pad' in the case where the namespace is misaligned relative
to its internal alignment. This is typically triggered in 1G aligned
namespace, but could theoretically trigger with small namespace
alignments. When this triggers the kernel reports messages of the form:

    dax2.1: bad offset: 0x3c000000 dax disabled align: 0x40000000

Fixes: 1ee6667cd8d1 ("libnvdimm, pfn, dax: fix initialization vs autodetect...")
Reported-by: Jane Chu <jane.chu@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/pfn_devs.c