Re: [PATCH v2] nvdimm/pmem: Fix leak on dax_add_host() failure

2024-02-16 Thread Mathieu Desnoyers
On 2024-02-15 09:43, Mathieu Desnoyers wrote: Fix a leak on dax_add_host() error, where "goto out_cleanup_dax" is done before setting pmem->dax_dev, which therefore issues the two following calls on NULL pointers: Hi Andrew, I notice that you should update the patch you have

[PATCH v6 8/9] Introduce cpu_dcache_is_aliasing() across all architectures

2024-02-15 Thread Mathieu Desnoyers
"CPU data cache" and "CPU cache" to eliminate any possible confusion with VFS "dentry cache" and "page cache". Link: https://lore.kernel.org/lkml/20030910210416.ga24...@mail.jlokier.co.uk/ Fixes: d92576f1167c ("dax: does not work correctly with virtual alias

[PATCH v6 9/9] dax: Fix incorrect list of data cache aliasing architectures

2024-02-15 Thread Mathieu Desnoyers
iasing data caches. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Be

[PATCH v6 7/9] dax: Check for data cache aliasing at runtime

2024-02-15 Thread Mathieu Desnoyers
: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King

[PATCH v6 5/9] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure

2024-02-15 Thread Mathieu Desnoyers
selects DAX, a return value of -EOPNOTSUPP from alloc_dax() should make dcssblk_add_store() fail. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Acked-by: Heiko Carstens Cc: Alasdair Kergon

[PATCH v6 6/9] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-15 Thread Mathieu Desnoyers
t;dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russel

[PATCH v6 3/9] nvdimm/pmem: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-15 Thread Mathieu Desnoyers
. ] Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang

[PATCH v6 4/9] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-15 Thread Mathieu Desnoyers
ed-by: Dan Williams Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King

[PATCH v6 2/9] dax: alloc_dax() return ERR_PTR(-EOPNOTSUPP) for CONFIG_DAX=n

2024-02-15 Thread Mathieu Desnoyers
aliasing at runtime. Fixes: 4e4ced93794a ("dax: Move mandatory ->zero_page_range() check in alloc_dax()") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd

[PATCH v6 1/9] dax: add empty static inline for CONFIG_DAX=n

2024-02-15 Thread Mathieu Desnoyers
: 7ac5360cd4d0 ("dax: remove the copy_from_iter and copy_to_iter methods") Signed-off-by: Mathieu Desnoyers Cc: Christoph Hellwig Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King

[PATCH v6 0/9] Introduce cpu_dcache_is_aliasing() to fix DAX regression

2024-02-15 Thread Mathieu Desnoyers
Cc: linux-fsde...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-...@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvd...@lists.linux.dev Cc: linux-s...@vger.kernel.org Mathieu Desnoyers (9): dax: add empty static inline for CONFIG_DAX=n dax: alloc_dax() return ERR_PTR(-EOPNOTSUPP) for

[PATCH v2] nvdimm/pmem: Fix leak on dax_add_host() failure

2024-02-15 Thread Mathieu Desnoyers
Fix a leak on dax_add_host() error, where "goto out_cleanup_dax" is done before setting pmem->dax_dev, which therefore issues the two following calls on NULL pointers: out_cleanup_dax: kill_dax(pmem->dax_dev); put_dax(pmem->dax_dev); Signed-off-by: Mathieu

Re: [PATCH v5 5/8] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-13 Thread Mathieu Desnoyers
*, if (!IS_ERR_OR_NULL(_T)) virtio_fs_cleanup_dax(_T)) and define the variable as: struct dax_device *dax_dev __free(cleanup_dax) = NULL; Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com

Re: [PATCH v5 1/8] dax: alloc_dax() return ERR_PTR(-EOPNOTSUPP) for CONFIG_DAX=n

2024-02-13 Thread Mathieu Desnoyers
On 2024-02-13 14:07, Dan Williams wrote: Lukas Wunner wrote: On Mon, Feb 12, 2024 at 11:30:54AM -0500, Mathieu Desnoyers wrote: Change the return value from NULL to PTR_ERR(-EOPNOTSUPP) for CONFIG_DAX=n to be consistent with the fact that CONFIG_DAX=y never returns NULL. All the callers

Re: [PATCH v5 5/8] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-13 Thread Mathieu Desnoyers
On 2024-02-13 01:25, Lukas Wunner wrote: On Mon, Feb 12, 2024 at 11:30:58AM -0500, Mathieu Desnoyers wrote: In preparation for checking whether the architecture has data cache aliasing within alloc_dax(), modify the error handling of virtio virtio_fs_setup_dax() to treat alloc_dax() -EOPNOTSUPP

[PATCH v5 8/8] dax: Fix incorrect list of data cache aliasing architectures

2024-02-12 Thread Mathieu Desnoyers
iasing data caches. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Be

[PATCH v5 7/8] Introduce cpu_dcache_is_aliasing() across all architectures

2024-02-12 Thread Mathieu Desnoyers
"CPU data cache" and "CPU cache" to eliminate any possible confusion with VFS "dentry cache" and "page cache". Link: https://lore.kernel.org/lkml/20030910210416.ga24...@mail.jlokier.co.uk/ Fixes: d92576f1167c ("dax: does not work correctly with virtual alias

[PATCH v5 6/8] dax: Check for data cache aliasing at runtime

2024-02-12 Thread Mathieu Desnoyers
: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King

[PATCH v5 5/8] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-12 Thread Mathieu Desnoyers
t;dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russel

[PATCH v5 4/8] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure

2024-02-12 Thread Mathieu Desnoyers
selects DAX, a return value of -EOPNOTSUPP from alloc_dax() should make dcssblk_add_store() fail. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas P

[PATCH v5 3/8] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-12 Thread Mathieu Desnoyers
ed-by: Dan Williams Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King

[PATCH v5 2/8] nvdimm/pmem: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-12 Thread Mathieu Desnoyers
. ] Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang

[PATCH v5 0/8] Introduce cpu_dcache_is_aliasing() to fix DAX regression

2024-02-12 Thread Mathieu Desnoyers
c: Matthew Wilcox Cc: Russell King Cc: linux-a...@vger.kernel.org Cc: linux-...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-...@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvd...@lists.linux.dev Cc: linux-s...@vger.kernel.org Mathieu Desnoyers (8):

[PATCH v5 1/8] dax: alloc_dax() return ERR_PTR(-EOPNOTSUPP) for CONFIG_DAX=n

2024-02-12 Thread Mathieu Desnoyers
aliasing at runtime. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Be

[PATCH] nvdimm/pmem: Fix leak on dax_add_host() failure

2024-02-12 Thread Mathieu Desnoyers
Fix a leak on dax_add_host() error, where "goto out_cleanup_dax" is done before setting pmem->dax_dev, which therefore issues the two following calls on NULL pointers: out_cleanup_dax: kill_dax(pmem->dax_dev); put_dax(pmem->dax_dev); Signed-off-by: Mathieu

Re: [PATCH v4 06/12] dax: Check for data cache aliasing at runtime

2024-02-08 Thread Mathieu Desnoyers
On 2024-02-08 17:37, Dan Williams wrote: Mathieu Desnoyers wrote: On 2024-02-08 16:39, Dan Williams wrote: [...] So per other feedback on earlier patches, I think this hunk deserves to be moved to its own patch earlier in the series as a standalone fixup. Done. Rest of this patch looks

Re: [PATCH v4 01/12] nvdimm/pmem: Fix leak on dax_add_host() failure

2024-02-08 Thread Mathieu Desnoyers
On 2024-02-08 17:12, Andrew Morton wrote: On Thu, 8 Feb 2024 17:04:52 -0500 Mathieu Desnoyers wrote: [...] Should I keep this patch 01/12 within the series for v5 or should I send it separately ? Doesn't matter much, but perfectionism does say "standalone patch please". Will

Re: [PATCH v4 09/12] nvdimm/pmem: Cleanup alloc_dax() error handling

2024-02-08 Thread Mathieu Desnoyers
case from the beginning, and then doing the EOPNOTSUPP fixups. ...repeat this comment for patch 10, 11, 12. Done. Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com

Re: [PATCH v4 06/12] dax: Check for data cache aliasing at runtime

2024-02-08 Thread Mathieu Desnoyers
if OK with you. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com

Re: [PATCH v4 05/12] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-08 Thread Mathieu Desnoyers
(-EOPNOTSUPP)? Done. Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com

Re: [PATCH v4 04/12] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure

2024-02-08 Thread Mathieu Desnoyers
On 2024-02-08 16:36, Dan Williams wrote: [...] Just another "ditto" on alloc_dax() returning NULL so that the ternary can be removed, but otherwise this looks good. Done. Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com

Re: [PATCH v4 03/12] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-08 Thread Mathieu Desnoyers
() in the CONFIG_DAX=n case. Done. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com

Re: [PATCH v4 02/12] nvdimm/pmem: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-08 Thread Mathieu Desnoyers
On 2024-02-08 16:32, Dan Williams wrote: Mathieu Desnoyers wrote: In preparation for checking whether the architecture has data cache aliasing within alloc_dax(), modify the error handling of nvdimm/pmem pmem_attach_disk() to treat alloc_dax() -EOPNOTSUPP failure as non-fatal

Re: [PATCH v4 01/12] nvdimm/pmem: Fix leak on dax_add_host() failure

2024-02-08 Thread Mathieu Desnoyers
On 2024-02-08 16:21, Andrew Morton wrote: On Thu, 8 Feb 2024 13:49:02 -0500 Mathieu Desnoyers wrote: Fix a leak on dax_add_host() error, where "goto out_cleanup_dax" is done before setting pmem->dax_dev, which therefore issues the two following calls on NULL pointers: ou

[PATCH v4 11/12] dcssblk: Cleanup alloc_dax() error handling

2024-02-08 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[PATCH v4 12/12] virtio: Cleanup alloc_dax() error handling

2024-02-08 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[PATCH v4 07/12] Introduce cpu_dcache_is_aliasing() across all architectures

2024-02-08 Thread Mathieu Desnoyers
"CPU data cache" and "CPU cache" to eliminate any possible confusion with VFS "dentry cache" and "page cache". Link: https://lore.kernel.org/lkml/20030910210416.ga24...@mail.jlokier.co.uk/ Fixes: d92576f1167c ("dax: does not work correctly with virtual alias

[PATCH v4 06/12] dax: Check for data cache aliasing at runtime

2024-02-08 Thread Mathieu Desnoyers
: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: linux-a...@vger.kernel.org

[PATCH v4 09/12] nvdimm/pmem: Cleanup alloc_dax() error handling

2024-02-08 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[PATCH v4 08/12] dax: Fix incorrect list of data cache aliasing architectures

2024-02-08 Thread Mathieu Desnoyers
iasing data caches. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: l

[PATCH v4 10/12] dm: Cleanup alloc_dax() error handling

2024-02-08 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[PATCH v4 05/12] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-08 Thread Mathieu Desnoyers
-EOPNOTSUPP. Co-developed-by: Dan Williams Signed-off-by: Dan Williams Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvald

[PATCH v4 03/12] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-08 Thread Mathieu Desnoyers
. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Suggested-by: Dan Williams Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave

[PATCH v4 04/12] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure

2024-02-08 Thread Mathieu Desnoyers
selects DAX, a return value of -EOPNOTSUPP from alloc_dax() should make dcssblk_add_store() fail. For the transition, consider that alloc_dax() returning NULL is the same as returning -EOPNOTSUPP. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-b

[PATCH v4 00/12] Introduce cpu_dcache_is_aliasing() to fix DAX regression

2024-02-08 Thread Mathieu Desnoyers
l.org Cc: linux-...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-...@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvd...@lists.linux.dev Cc: linux-s...@vger.kernel.org Mathieu Desnoyers (12): nvdimm/pmem: Fix leak on dax_add_host() failure nvdimm/pmem: Treat alloc_

[PATCH v4 01/12] nvdimm/pmem: Fix leak on dax_add_host() failure

2024-02-08 Thread Mathieu Desnoyers
Fix a leak on dax_add_host() error, where "goto out_cleanup_dax" is done before setting pmem->dax_dev, which therefore issues the two following calls on NULL pointers: out_cleanup_dax: kill_dax(pmem->dax_dev); put_dax(pmem->dax_dev); Signed-off-by: Mathieu Desn

[PATCH v4 02/12] nvdimm/pmem: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-08 Thread Mathieu Desnoyers
-EOPNOTSUPP. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang C

[RFC PATCH v4 11/12] dcssblk: Cleanup alloc_dax() error handling

2024-02-02 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[RFC PATCH v4 12/12] virtio: Cleanup alloc_dax() error handling

2024-02-02 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[RFC PATCH v4 09/12] nvdimm/pmem: Cleanup alloc_dax() error handling

2024-02-02 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[RFC PATCH v4 10/12] dm: Cleanup alloc_dax() error handling

2024-02-02 Thread Mathieu Desnoyers
Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma

[RFC PATCH v4 07/12] Introduce cpu_dcache_is_aliasing() across all architectures

2024-02-02 Thread Mathieu Desnoyers
"CPU data cache" and "CPU cache" to eliminate any possible confusion with VFS "dentry cache" and "page cache". Link: https://lore.kernel.org/lkml/20030910210416.ga24...@mail.jlokier.co.uk/ Fixes: d92576f1167c ("dax: does not work correctly with virtual alias

[RFC PATCH v4 08/12] dax: Fix incorrect list of data cache aliasing architectures

2024-02-02 Thread Mathieu Desnoyers
iasing data caches. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: l

[RFC PATCH v4 05/12] virtio: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-02 Thread Mathieu Desnoyers
-EOPNOTSUPP. Co-developed-by: Dan Williams Signed-off-by: Dan Williams Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvald

[RFC PATCH v4 06/12] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: linux-a...@vger.kernel.org

[RFC PATCH v4 04/12] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure

2024-02-02 Thread Mathieu Desnoyers
selects DAX, a return value of -EOPNOTSUPP from alloc_dax() should make dcssblk_add_store() fail. For the transition, consider that alloc_dax() returning NULL is the same as returning -EOPNOTSUPP. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-b

[RFC PATCH v4 00/12] Introduce cpu_dcache_is_aliasing() to fix DAX regression

2024-02-02 Thread Mathieu Desnoyers
l.org Cc: linux-...@vger.kernel.org Cc: linux-fsde...@vger.kernel.org Cc: linux...@kvack.org Cc: linux-...@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvd...@lists.linux.dev Cc: linux-s...@vger.kernel.org Mathieu Desnoyers (12): nvdimm/pmem: Fix leak on dax_add_host() failure nvdimm/pmem: Treat alloc_

[RFC PATCH v4 03/12] dm: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-02 Thread Mathieu Desnoyers
. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Suggested-by: Dan Williams Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave

[RFC PATCH v4 02/12] nvdimm/pmem: Treat alloc_dax() -EOPNOTSUPP failure as non-fatal

2024-02-02 Thread Mathieu Desnoyers
-EOPNOTSUPP. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang C

[RFC PATCH v4 01/12] nvdimm/pmem: Fix leak on dax_add_host() failure

2024-02-02 Thread Mathieu Desnoyers
Fix a leak on dax_add_host() error, where "goto out_cleanup_dax" is done before setting pmem->dax_dev, which therefore issues the two following calls on NULL pointers: out_cleanup_dax: kill_dax(pmem->dax_dev); put_dax(pmem->dax_dev); Signed-off-by: Mathieu Desn

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-02 15:14, Dan Williams wrote: Mathieu Desnoyers wrote: [..] Thanks for that. All of those need to be done before the fs goes live later in virtio_device_ready(), but before that point nothing should be calling into virtio_fs_dax_ops, so as far as I can see it is safe to change

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-02 14:41, Dan Williams wrote: Mathieu Desnoyers wrote: On 2024-02-02 12:37, Dan Williams wrote: Mathieu Desnoyers wrote: [...] The alternative route I intend to take is to audit all callers of alloc_dax() and make sure they all save the alloc_dax() return value in a struct

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-02 12:37, Dan Williams wrote: Mathieu Desnoyers wrote: [...] The alternative route I intend to take is to audit all callers of alloc_dax() and make sure they all save the alloc_dax() return value in a struct dax_device * local variable first for the sake of checking for IS_ERR

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-01 10:44, Mathieu Desnoyers wrote: On 2024-01-31 17:18, Dan Williams wrote: [...] diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 5f1be1da92ce..11053a70f5ab 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -16,6 +16,7 @@   #include   #include

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-02 Thread Mathieu Desnoyers
On 2024-02-01 10:44, Mathieu Desnoyers wrote: [...] diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 4e8fdcb3f1c8..b69c9e442cf4 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -560,17 +560,19 @@ static int pmem_attach_disk(struct device *dev,   dax_dev

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-02-01 Thread Mathieu Desnoyers
On 2024-01-31 17:18, Dan Williams wrote: Mathieu Desnoyers wrote: On 2024-01-31 16:02, Dan Williams wrote: Mathieu Desnoyers wrote: Replace the following fs/Kconfig:FS_DAX dependency: depends on !(ARM || MIPS || SPARC) By a runtime check within alloc_dax(). This is done in preparation

Re: [RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-01-31 Thread Mathieu Desnoyers
On 2024-01-31 16:02, Dan Williams wrote: Mathieu Desnoyers wrote: Replace the following fs/Kconfig:FS_DAX dependency: depends on !(ARM || MIPS || SPARC) By a runtime check within alloc_dax(). This is done in preparation for its use by each filesystem supporting the "dax" mo

Re: [RFC PATCH v3 3/4] Introduce cpu_dcache_is_aliasing() across all architectures

2024-01-31 Thread Mathieu Desnoyers
Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com

[RFC PATCH v3 4/4] dax: Fix incorrect list of data cache aliasing architectures

2024-01-31 Thread Mathieu Desnoyers
es. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Linus Torvalds Cc: linux...@kvack.org Cc: linux-a...@vger.kernel.org Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox C

[RFC PATCH v3 3/4] Introduce cpu_dcache_is_aliasing() across all architectures

2024-01-31 Thread Mathieu Desnoyers
"CPU data cache" and "CPU cache" to eliminate any possible confusion with VFS "dentry cache" and "page cache". Link: https://lore.kernel.org/lkml/20030910210416.ga24...@mail.jlokier.co.uk/ Fixes: d92576f1167c ("dax: does not work correctly

[RFC PATCH v3 1/4] dm: Treat alloc_dax failure as non-fatal

2024-01-31 Thread Mathieu Desnoyers
n Williams Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: dm-devel@lists.linux.dev Cc: Andrew Morton Cc: Linus Torvalds Cc: linux...@kvack.org Cc: linux-a...@vger.kernel.org Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox

[RFC PATCH v3 0/4] Introduce cpu_dcache_is_aliasing() to fix DAX regression

2024-01-31 Thread Mathieu Desnoyers
er.kernel.org Cc: nvd...@lists.linux.dev Cc: linux-fsde...@vger.kernel.org Cc: dm-devel@lists.linux.dev Mathieu Desnoyers (4): dm: Treat alloc_dax failure as non-fatal dax: Check for data cache aliasing at runtime Introduce cpu_dcache_is_aliasing() across all architectures dax: Fix incorrec

[RFC PATCH v3 2/4] dax: Check for data cache aliasing at runtime

2024-01-31 Thread Mathieu Desnoyers
reparation for using cpu_dcache_is_aliasing() in a following change which will properly support architectures which detect data cache aliasing at runtime. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton