lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240809031155.2837271-1-chengzhihao1@huawei.com>
Date: Fri, 9 Aug 2024 11:11:55 +0800
From: Zhihao Cheng <chengzhihao1@...wei.com>
To: <dan.j.williams@...el.com>, <vishal.l.verma@...el.com>,
	<dave.jiang@...el.com>, <ira.weiny@...el.com>, <hch@....de>,
	<alison.schofield@...el.com>
CC: <nvdimm@...ts.linux.dev>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases

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@...wei.com>
Reviewed-by: Christoph Hellwig <hch@....de>
Reviewed-by: Dave Jiang <dave.jiang@...el.com>
Reviewed-by: Ira Weiny <ira.weiny@...el.com>
Tested-by: Ira Weiny <ira.weiny@...el.com>
Tested-by: Alison Schofield <alison.schofield@...el.com>
---
 v1->v2: Update commit msg according to Alison's suggestion, add error
         message.
 drivers/nvdimm/pmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 1ae8b2351654..210fb77f51ba 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -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),
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ