Commit 9c412428 authored by Dan Williams's avatar Dan Williams

libnvdimm: fix mode determination for e820 devices

Correctly display "safe" mode when a btt is established on a e820/memmap
defined pmem namespace.
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 92e963f5
......@@ -1277,10 +1277,12 @@ static ssize_t mode_show(struct device *dev,
device_lock(dev);
claim = ndns->claim;
if (pmem_should_map_pages(dev) || (claim && is_nd_pfn(claim)))
mode = "memory";
else if (claim && is_nd_btt(claim))
if (claim && is_nd_btt(claim))
mode = "safe";
else if (claim && is_nd_pfn(claim))
mode = "memory";
else if (!claim && pmem_should_map_pages(dev))
mode = "memory";
else
mode = "raw";
rc = sprintf(buf, "%s\n", mode);
......
Markdown is supported
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