Re: [PATCH] vfs: replace ints with enum component_type for LAST_XXX

From: Jori Koolstra

Date: Thu Apr 02 2026 - 05:23:48 EST



> Op 02-04-2026 08:25 CEST schreef kernel test robot <lkp@xxxxxxxxx>:
>
>
> Hi Jori,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on brauner-vfs/vfs.all]
> [also build test ERROR on linus/master viro-vfs/for-next v7.0-rc6 next-20260331]
> [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/Jori-Koolstra/vfs-replace-ints-with-enum-component_type-for-LAST_XXX/20260401-024525
> base: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
> patch link: https://lore.kernel.org/r/20260331173726.3517440-1-jkoolstra%40xs4all.nl
> patch subject: [PATCH] vfs: replace ints with enum component_type for LAST_XXX
> config: hexagon-allmodconfig
> compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
> reproduce (this is a W=1 build):
>
> 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@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202604020519.RLV5cfGp-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> >> fs/smb/server/vfs.c:71:23: error: incompatible pointer types passing 'int *' to parameter of type 'enum component_type *' [-Werror,-Wincompatible-pointer-types]
> 71 | path, &last, &type,
> | ^~~~~
> include/linux/namei.h:70:68: note: passing argument to parameter 'type' here
> 70 | struct path *parent, struct qstr *last, enum component_type *type,
> | ^
> >> fs/smb/server/vfs.c:76:23: error: use of undeclared identifier 'LAST_NORM'
> 76 | if (unlikely(type != LAST_NORM)) {
> | ^
> fs/smb/server/vfs.c:681:32: error: incompatible pointer types passing 'int *' to parameter of type 'enum component_type *' [-Werror,-Wincompatible-pointer-types]
> 681 | &new_path, &new_last, &new_type,
> | ^~~~~~~~~
> include/linux/namei.h:70:68: note: passing argument to parameter 'type' here
> 70 | struct path *parent, struct qstr *last, enum component_type *type,
> | ^
> 3 errors generated.
>
>
> vim +71 fs/smb/server/vfs.c
>
> f44158485826c0 fs/cifsd/vfs.c Namjae Jeon 2021-03-16 52
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 53 static int ksmbd_vfs_path_lookup(struct ksmbd_share_config *share_conf,
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 54 char *pathname, unsigned int flags,
> 1ead2213dd7d14 fs/smb/server/vfs.c NeilBrown 2025-11-13 55 struct path *path, bool for_remove)
> f44158485826c0 fs/cifsd/vfs.c Namjae Jeon 2021-03-16 56 {
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 57 struct qstr last;
> 94cb22d109d517 fs/smb/server/vfs.c Al Viro 2025-07-06 58 const struct path *root_share_path = &share_conf->vfs_path;
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 59 int err, type;
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 60 struct dentry *d;
> f44158485826c0 fs/cifsd/vfs.c Namjae Jeon 2021-03-16 61
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 62 if (pathname[0] == '\0') {
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 63 pathname = share_conf->path;
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 64 root_share_path = NULL;
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 65 } else {
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 66 flags |= LOOKUP_BENEATH;
> ff1d57272552e4 fs/cifsd/vfs.c Namjae Jeon 2021-04-13 67 }
> f44158485826c0 fs/cifsd/vfs.c Namjae Jeon 2021-03-16 68
> 39537a335a6189 fs/smb/server/vfs.c Al Viro 2025-12-14 69 CLASS(filename_kernel, filename)(pathname);
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 70 err = vfs_path_parent_lookup(filename, flags,
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 @71 path, &last, &type,
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 72 root_share_path);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 73 if (err)
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 74 return err;
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 75
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 @76 if (unlikely(type != LAST_NORM)) {
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 77 path_put(path);
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 78 return -ENOENT;
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 79 }
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 80
> 1ead2213dd7d14 fs/smb/server/vfs.c NeilBrown 2025-11-13 81 if (for_remove) {
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 82 err = mnt_want_write(path->mnt);
> 864fb5d3716303 fs/smb/server/vfs.c Namjae Jeon 2023-11-20 83 if (err) {
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 84 path_put(path);
> 864fb5d3716303 fs/smb/server/vfs.c Namjae Jeon 2023-11-20 85 return -ENOENT;
> 864fb5d3716303 fs/smb/server/vfs.c Namjae Jeon 2023-11-20 86 }
> 864fb5d3716303 fs/smb/server/vfs.c Namjae Jeon 2023-11-20 87
> 1ead2213dd7d14 fs/smb/server/vfs.c NeilBrown 2025-11-13 88 d = start_removing_noperm(path->dentry, &last);
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 89
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 90 if (!IS_ERR(d)) {
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 91 dput(path->dentry);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 92 path->dentry = d;
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 93 return 0;
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 94 }
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 95 mnt_drop_write(path->mnt);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 96 path_put(path);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 97 return -ENOENT;
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 98 }
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 99
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 100 d = lookup_noperm_unlocked(&last, path->dentry);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 101 if (!IS_ERR(d) && d_is_negative(d)) {
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 102 dput(d);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 103 d = ERR_PTR(-ENOENT);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 104 }
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 105 if (IS_ERR(d)) {
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 106 path_put(path);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 107 return -ENOENT;
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 108 }
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 109 dput(path->dentry);
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 110 path->dentry = d;
> 2b57a4322b1b14 fs/smb/server/vfs.c Namjae Jeon 2023-07-17 111
> 2b57a4322b1b14 fs/smb/server/vfs.c Namjae Jeon 2023-07-17 112 if (test_share_config_flag(share_conf, KSMBD_SHARE_FLAG_CROSSMNT)) {
> 2b57a4322b1b14 fs/smb/server/vfs.c Namjae Jeon 2023-07-17 113 err = follow_down(path, 0);
> 2b57a4322b1b14 fs/smb/server/vfs.c Namjae Jeon 2023-07-17 114 if (err < 0) {
> 2b57a4322b1b14 fs/smb/server/vfs.c Namjae Jeon 2023-07-17 115 path_put(path);
> 4e45cca31d4e70 fs/smb/server/vfs.c NeilBrown 2025-07-24 116 return -ENOENT;
> 2b57a4322b1b14 fs/smb/server/vfs.c Namjae Jeon 2023-07-17 117 }
> 2b57a4322b1b14 fs/smb/server/vfs.c Namjae Jeon 2023-07-17 118 }
> 74d7970febf7e9 fs/ksmbd/vfs.c Namjae Jeon 2023-04-21 119 return 0;
> f44158485826c0 fs/cifsd/vfs.c Namjae Jeon 2021-03-16 120 }
> f44158485826c0 fs/cifsd/vfs.c Namjae Jeon 2021-03-16 121
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

These should have been resolved in the v2 patch already. I missed the reference in
fs/smb/sever/vfs.c initially. My LSP config was off, probably should've just rg'ed
it in the first place...