libnvdimm, pfn: Fix over-trim in trim_pfn_device()
authorWei Yang <richardw.yang@linux.intel.com>
Tue, 22 Jan 2019 02:48:09 +0000 (10:48 +0800)
committerDan Williams <dan.j.williams@intel.com>
Tue, 12 Feb 2019 18:18:44 +0000 (10:18 -0800)
commitf101ada7da6551127d192c2f1742c1e9e0f62799
treedcb5fdae196c8c5ed566b074c56d2c045d5a91c9
parentf17b5f06cb92ef2250513a1e154c47b78df07d40
libnvdimm, pfn: Fix over-trim in trim_pfn_device()

When trying to see whether current nd_region intersects with others,
trim_pfn_device() has already calculated the *size* to be expanded to
SECTION size.

Do not double append 'adjust' to 'size' when calculating whether the end
of a region collides with the next pmem region.

Fixes: ae86cbfef381 "libnvdimm, pfn: Pad pfn namespaces relative to other regions"
Cc: <stable@vger.kernel.org>
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/pfn_devs.c