linux-next: build failure in the vfs tree

Mark Brown posted 1 patch 2 weeks, 2 days ago
fs/nsfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
linux-next: build failure in the vfs tree
Posted by Mark Brown 2 weeks, 2 days ago
Hi all,

After merging the vfs tree, today's linux-next build (arm64 defconfig)
failed like this:

/tmp/next/build/fs/nsfs.c:582:27: error: initialization of 'struct file * (*)(const struct path *, unsigned int)' from incompatible pointer type 'struct file * (*)(struct path *, unsigned int)' [-Wincompatible-pointer-types]
  582 |         .open           = nsfs_export_open,
      |                           ^~~~~~~~~~~~~~~~
/tmp/next/build/fs/nsfs.c:582:27: note: (near initialization for 'nsfs_export_operations.open')

Caused by an interaction with commit

  06c4ff965e95b ("nsfs: support file handles")

from the vfs-brauner tree and

  efa6ab3688a54 ("export_operations->open(): constify path argument")

I've fixed it up as below and can carry as required.

From 56e625f1566ee6e3940c625a393b3b4e75806b3f Mon Sep 17 00:00:00 2001
From: Mark Brown <broonie@kernel.org>
Date: Mon, 15 Sep 2025 21:03:13 +0100
Subject: [PATCH] nsfs: Fix up merge

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 fs/nsfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nsfs.c b/fs/nsfs.c
index 8484bc4dd3deb..32cb8c835a2ba 100644
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -571,7 +571,7 @@ static int nsfs_export_permission(struct handle_to_path_ctx *ctx,
 	return 0;
 }
 
-static struct file *nsfs_export_open(struct path *path, unsigned int oflags)
+static struct file *nsfs_export_open(const struct path *path, unsigned int oflags)
 {
 	return file_open_root(path, "", oflags, 0);
 }
-- 
2.47.2

.
Re: linux-next: build failure in the vfs tree
Posted by kernel test robot 2 weeks, 2 days ago
Hi Mark,

kernel test robot noticed the following build errors:

[auto build test ERROR on brauner-vfs/vfs.all]
[cannot apply to linus/master v6.17-rc6 next-20250915]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Mark-Brown/linux-next-build-failure-in-the-vfs-tree/20250916-041652
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/aMhzi0WpakpN7oH5%40sirena.org.uk
patch subject: linux-next: build failure in the vfs tree
config: hexagon-randconfig-002-20250916 (https://download.01.org/0day-ci/archive/20250916/202509161649.GzVNYeqs-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 65ad21d730d25789454d18e811f8ff5db79cb5d4)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250916/202509161649.GzVNYeqs-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509161649.GzVNYeqs-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/nsfs.c:582:11: error: incompatible function pointer types initializing 'struct file *(*)(struct path *, unsigned int)' with an expression of type 'struct file *(const struct path *, unsigned int)' [-Wincompatible-function-pointer-types]
     582 |         .open           = nsfs_export_open,
         |                           ^~~~~~~~~~~~~~~~
   1 error generated.


vim +582 fs/nsfs.c

06c4ff965e95b0b Christian Brauner 2025-09-12  578  
06c4ff965e95b0b Christian Brauner 2025-09-12  579  static const struct export_operations nsfs_export_operations = {
06c4ff965e95b0b Christian Brauner 2025-09-12  580  	.encode_fh	= nsfs_encode_fh,
06c4ff965e95b0b Christian Brauner 2025-09-12  581  	.fh_to_dentry	= nsfs_fh_to_dentry,
06c4ff965e95b0b Christian Brauner 2025-09-12 @582  	.open		= nsfs_export_open,
06c4ff965e95b0b Christian Brauner 2025-09-12  583  	.permission	= nsfs_export_permission,
06c4ff965e95b0b Christian Brauner 2025-09-12  584  };
06c4ff965e95b0b Christian Brauner 2025-09-12  585  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki