libnvdimm, btt: Fix an incompatibility in the log layout
authorVishal Verma <vishal.l.verma@intel.com>
Mon, 18 Dec 2017 16:28:39 +0000 (09:28 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Dec 2017 16:53:49 +0000 (17:53 +0100)
commit166f39bc340d0eb739d31ddd347df593d7b6ff97
tree9e1d64d8d3138c4a87855c4d95baaa56df5bfe5a
parent6d80b15a226e59ebbc3ca8c14b65885bc8ffb2b9
libnvdimm, btt: Fix an incompatibility in the log layout

commit 24e3a7fb60a9187e5df90e5fa655ffc94b9c4f77 upstream.

Due to a spec misinterpretation, the Linux implementation of the BTT log
area had different padding scheme from other implementations, such as
UEFI and NVML.

This fixes the padding scheme, and defaults to it for new BTT layouts.
We attempt to detect the padding scheme in use when probing for an
existing BTT. If we detect the older/incompatible scheme, we continue
using it.

Reported-by: Juston Li <juston.li@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Fixes: 5212e11fde4d ("nd_btt: atomic sector updates")
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/btt.c
drivers/nvdimm/btt.h