* [PATCH] dax: add set_dax_nomc() and set_dax_nocache() stub helpers
@ 2024-02-16 20:22 Arnd Bergmann
2024-02-16 20:26 ` Mathieu Desnoyers
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-02-16 20:22 UTC (permalink / raw)
To: Dan Williams, Mathieu Desnoyers, Andrew Morton
Cc: Arnd Bergmann, kernel test robot, Matthew Wilcox, Jan Kara,
Jane Chu, linux-fsdevel, nvdimm, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
In some randconfig builds, the IS_ERR() check appears to not get completely
eliminated, resulting in the compiler to insert references to these two
functions that cause a link failure:
ERROR: modpost: "set_dax_nocache" [drivers/md/dm-mod.ko] undefined!
ERROR: modpost: "set_dax_nomc" [drivers/md/dm-mod.ko] undefined!
Add more stub functions for the dax-disabled case here to make it build again.
Fixes: d888f6b0a766 ("dm: treat alloc_dax() -EOPNOTSUPP failure as non-fatal")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202402160420.e4QKwoGO-lkp@intel.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/dax.h | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/include/linux/dax.h b/include/linux/dax.h
index df2d52b8a245..4527c10016fb 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -64,6 +64,9 @@ void dax_write_cache(struct dax_device *dax_dev, bool wc);
bool dax_write_cache_enabled(struct dax_device *dax_dev);
bool dax_synchronous(struct dax_device *dax_dev);
void set_dax_synchronous(struct dax_device *dax_dev);
+void set_dax_nocache(struct dax_device *dax_dev);
+void set_dax_nomc(struct dax_device *dax_dev);
+
size_t dax_recovery_write(struct dax_device *dax_dev, pgoff_t pgoff,
void *addr, size_t bytes, struct iov_iter *i);
/*
@@ -108,6 +111,12 @@ static inline bool dax_synchronous(struct dax_device *dax_dev)
static inline void set_dax_synchronous(struct dax_device *dax_dev)
{
}
+static inline void set_dax_nocache(struct dax_device *dax_dev)
+{
+}
+static inline void set_dax_nomc(struct dax_device *dax_dev)
+{
+}
static inline bool daxdev_mapping_supported(struct vm_area_struct *vma,
struct dax_device *dax_dev)
{
@@ -120,9 +129,6 @@ static inline size_t dax_recovery_write(struct dax_device *dax_dev,
}
#endif
-void set_dax_nocache(struct dax_device *dax_dev);
-void set_dax_nomc(struct dax_device *dax_dev);
-
struct writeback_control;
#if defined(CONFIG_BLOCK) && defined(CONFIG_FS_DAX)
int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk);
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] dax: add set_dax_nomc() and set_dax_nocache() stub helpers
2024-02-16 20:22 [PATCH] dax: add set_dax_nomc() and set_dax_nocache() stub helpers Arnd Bergmann
@ 2024-02-16 20:26 ` Mathieu Desnoyers
0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2024-02-16 20:26 UTC (permalink / raw)
To: Arnd Bergmann, Dan Williams, Andrew Morton
Cc: Arnd Bergmann, kernel test robot, Matthew Wilcox, Jan Kara,
Jane Chu, linux-fsdevel, nvdimm, linux-kernel
On 2024-02-16 15:22, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> In some randconfig builds, the IS_ERR() check appears to not get completely
> eliminated, resulting in the compiler to insert references to these two
> functions that cause a link failure:
>
> ERROR: modpost: "set_dax_nocache" [drivers/md/dm-mod.ko] undefined!
> ERROR: modpost: "set_dax_nomc" [drivers/md/dm-mod.ko] undefined!
>
> Add more stub functions for the dax-disabled case here to make it build again.
Hi Arnd,
Note that this is a duplicate of:
https://lore.kernel.org/lkml/20240215144633.96437-2-mathieu.desnoyers@efficios.com/
now present in Andrew's tree.
The only differences are the subject, commit message and a newline between "set_dax_nomc"
and "set_dax_synchronous" in your change.
Thanks,
Mathieu
>
> Fixes: d888f6b0a766 ("dm: treat alloc_dax() -EOPNOTSUPP failure as non-fatal")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202402160420.e4QKwoGO-lkp@intel.com/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> include/linux/dax.h | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/dax.h b/include/linux/dax.h
> index df2d52b8a245..4527c10016fb 100644
> --- a/include/linux/dax.h
> +++ b/include/linux/dax.h
> @@ -64,6 +64,9 @@ void dax_write_cache(struct dax_device *dax_dev, bool wc);
> bool dax_write_cache_enabled(struct dax_device *dax_dev);
> bool dax_synchronous(struct dax_device *dax_dev);
> void set_dax_synchronous(struct dax_device *dax_dev);
> +void set_dax_nocache(struct dax_device *dax_dev);
> +void set_dax_nomc(struct dax_device *dax_dev);
> +
> size_t dax_recovery_write(struct dax_device *dax_dev, pgoff_t pgoff,
> void *addr, size_t bytes, struct iov_iter *i);
> /*
> @@ -108,6 +111,12 @@ static inline bool dax_synchronous(struct dax_device *dax_dev)
> static inline void set_dax_synchronous(struct dax_device *dax_dev)
> {
> }
> +static inline void set_dax_nocache(struct dax_device *dax_dev)
> +{
> +}
> +static inline void set_dax_nomc(struct dax_device *dax_dev)
> +{
> +}
> static inline bool daxdev_mapping_supported(struct vm_area_struct *vma,
> struct dax_device *dax_dev)
> {
> @@ -120,9 +129,6 @@ static inline size_t dax_recovery_write(struct dax_device *dax_dev,
> }
> #endif
>
> -void set_dax_nocache(struct dax_device *dax_dev);
> -void set_dax_nomc(struct dax_device *dax_dev);
> -
> struct writeback_control;
> #if defined(CONFIG_BLOCK) && defined(CONFIG_FS_DAX)
> int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk);
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-16 20:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-16 20:22 [PATCH] dax: add set_dax_nomc() and set_dax_nocache() stub helpers Arnd Bergmann
2024-02-16 20:26 ` Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).