]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases
authorZhihao Cheng <chengzhihao1@huawei.com>
Fri, 9 Aug 2024 03:11:55 +0000 (11:11 +0800)
committerIra Weiny <ira.weiny@intel.com>
Fri, 9 Aug 2024 19:29:58 +0000 (14:29 -0500)
The dax is only supported on pfn type pmem devices since commit
f467fee48da4 ("block: move the dax flag to queue_limits"). Trying
to mount DAX filesystem fails with this error:
 mount: : wrong fs type, bad option, bad superblock on /dev/pmem7,
          missing codepage or helper program, or other error.
 dmesg(1) may have more information after failed mount system call.
 dmesg: EXT4-fs (pmem7): DAX unsupported by block device.

Fix the problem by adding dax flag setting for the missed case.

Fixes: f467fee48da4 ("block: move the dax flag to queue_limits")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/20240809031155.2837271-1-chengzhihao1@huawei.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
drivers/nvdimm/pmem.c

index 1ae8b2351654e7a7315c67025d9c453631a621f7..210fb77f51ba026d943bbb95eefce8abecdd344c 100644 (file)
@@ -498,7 +498,7 @@ static int pmem_attach_disk(struct device *dev,
        }
        if (fua)
                lim.features |= BLK_FEAT_FUA;
-       if (is_nd_pfn(dev))
+       if (is_nd_pfn(dev) || pmem_should_map_pages(dev))
                lim.features |= BLK_FEAT_DAX;
 
        if (!devm_request_mem_region(dev, res->start, resource_size(res),