* [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases
@ 2024-07-31 12:25 Zhihao Cheng
2024-07-31 15:53 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Zhihao Cheng @ 2024-07-31 12:25 UTC (permalink / raw)
To: dan.j.williams, vishal.l.verma, dave.jiang, hch, ira.weiny,
dlemoal, hare, axboe
Cc: nvdimm, linux-kernel
The dax is only supportted on pfn type pmem devices since commit
f467fee48da4 ("block: move the dax flag to queue_limits"), fix it
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>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases
2024-07-31 12:25 [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases Zhihao Cheng
@ 2024-07-31 15:53 ` Christoph Hellwig
2024-08-07 18:30 ` Dave Jiang
2024-08-08 19:28 ` Alison Schofield
2 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2024-07-31 15:53 UTC (permalink / raw)
To: Zhihao Cheng
Cc: dan.j.williams, vishal.l.verma, dave.jiang, hch, ira.weiny,
dlemoal, hare, axboe, nvdimm, linux-kernel
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases
2024-07-31 12:25 [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases Zhihao Cheng
2024-07-31 15:53 ` Christoph Hellwig
@ 2024-08-07 18:30 ` Dave Jiang
2024-08-08 19:28 ` Alison Schofield
2 siblings, 0 replies; 5+ messages in thread
From: Dave Jiang @ 2024-08-07 18:30 UTC (permalink / raw)
To: Zhihao Cheng, dan.j.williams, vishal.l.verma, hch, ira.weiny,
dlemoal, hare, axboe
Cc: nvdimm, linux-kernel
On 7/31/24 5:25 AM, Zhihao Cheng wrote:
> The dax is only supportted on pfn type pmem devices since commit
> f467fee48da4 ("block: move the dax flag to queue_limits"), fix it
> 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: Dave Jiang <dave.jiang@intel.com>
> ---
> 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),
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases
2024-07-31 12:25 [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases Zhihao Cheng
2024-07-31 15:53 ` Christoph Hellwig
2024-08-07 18:30 ` Dave Jiang
@ 2024-08-08 19:28 ` Alison Schofield
2 siblings, 0 replies; 5+ messages in thread
From: Alison Schofield @ 2024-08-08 19:28 UTC (permalink / raw)
To: Zhihao Cheng
Cc: dan.j.williams, vishal.l.verma, dave.jiang, hch, ira.weiny,
dlemoal, hare, axboe, nvdimm, linux-kernel
On Wed, Jul 31, 2024 at 08:25:30PM +0800, Zhihao Cheng wrote:
> The dax is only supportted on pfn type pmem devices since commit
> f467fee48da4 ("block: move the dax flag to queue_limits"), fix it
> by adding dax flag setting for the missed case.
s/supportted/supported
How about adding failure messages like this:
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.
Tested-by: Alison Schofield <alison.schofield@intel.com>
>
> Fixes: f467fee48da4 ("block: move the dax flag to queue_limits")
> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> ---
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases
@ 2024-08-09 3:11 Zhihao Cheng
0 siblings, 0 replies; 5+ messages in thread
From: Zhihao Cheng @ 2024-08-09 3:11 UTC (permalink / raw)
To: dan.j.williams, vishal.l.verma, dave.jiang, ira.weiny, hch,
alison.schofield
Cc: nvdimm, linux-kernel
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>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-09 3:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 12:25 [PATCH] nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases Zhihao Cheng
2024-07-31 15:53 ` Christoph Hellwig
2024-08-07 18:30 ` Dave Jiang
2024-08-08 19:28 ` Alison Schofield
-- strict thread matches above, loose matches on Subject: below --
2024-08-09 3:11 Zhihao Cheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox