Re: [PATCH RFC] fhandle: expose u64 mount id to name_to_handle_at(2)

kernel test robot
2024-05-21T03:03:46Z

Hi Aleksa,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:

[auto build test ERROR on 584bbf439d0fa83d728ec49f3a38c581bdc828b4]

url: https://github.com/intel-lab-lkp/linux/commits/Aleksa-Sarai/fhandle-expose-u64-mount-id-to-name_to_handle_at-2/20240521-053815
base: 584bbf439d0fa83d728ec49f3a38c581bdc828b4
patch link: https://lore.kernel.org/r/20240520-exportfs-u64-mount-id-v1-1-f55fd9215b8e%40cyphar.com
patch subject: [PATCH RFC] fhandle: expose u64 mount id to name_to_handle_at(2)
config: arm-allnoconfig (https://download.01.org/0day-ci/archive/20240521/202405211019.3ibjIxdf-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project fa9b1be45088dce1e4b602d451f118128b94237b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240521/202405211019.3ibjIxdf-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/202405211019.3ibjIxdf-lkp@intel.com/

All errors (new ones prefixed by >>):

In file included from fs/fhandle.c:2:
In file included from include/linux/syscalls.h:93:
In file included from include/trace/syscall.h:7:
In file included from include/linux/trace_events.h:6:
In file included from include/linux/ring_buffer.h:5:
In file included from include/linux/mm.h:2210:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> fs/fhandle.c:102:1: error: conflicting types for 'sys_name_to_handle_at'
102 | SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
| ^
include/linux/syscalls.h:227:36: note: expanded from macro 'SYSCALL_DEFINE5'
227 | #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
| ^
include/linux/syscalls.h:234:2: note: expanded from macro 'SYSCALL_DEFINEx'
234 | __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
| ^
include/linux/syscalls.h:248:18: note: expanded from macro '__SYSCALL_DEFINEx'
248 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
| ^
<scratch space>:17:1: note: expanded from here
17 | sys_name_to_handle_at
| ^
include/linux/syscalls.h:864:17: note: previous declaration is here
864 | asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name,
| ^
1 warning and 1 error generated.

vim +/sys_name_to_handle_at +102 fs/fhandle.c

990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 86
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 87 /**
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 88 * sys_name_to_handle_at: convert name to handle
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 89 * @dfd: directory relative to which name is interpreted if not absolute
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 90 * @name: name that should be converted to handle.
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 91 * @handle: resulting file handle
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 92 * @mnt_id: mount id of the file system containing the file
1702d25fd14170 Aleksa Sarai 2024-05-20 93 * (u64 if AT_HANDLE_UNIQUE_MNT_ID, otherwise int)
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 94 * @flag: flag value to indicate whether to follow symlink or not
96b2b072ee62be Amir Goldstein 2023-05-02 95 * and whether a decodable file handle is required.
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 96 *
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 97 * @handle->handle_size indicate the space available to store the
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 98 * variable part of the file handle in bytes. If there is not
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 99 * enough space, the field is updated to return the minimum
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 100 * value required.
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 101 */
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 @102 SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
1702d25fd14170 Aleksa Sarai 2024-05-20 103 struct file_handle __user *, handle, void __user *, mnt_id,
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 104 int, flag)
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 105 {
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 106 struct path path;
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 107 int lookup_flags;
96b2b072ee62be Amir Goldstein 2023-05-02 108 int fh_flags;
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 109 int err;
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 110
1702d25fd14170 Aleksa Sarai 2024-05-20 111 if (flag & ~(AT_SYMLINK_FOLLOW | AT_EMPTY_PATH | AT_HANDLE_FID |
1702d25fd14170 Aleksa Sarai 2024-05-20 112 AT_HANDLE_UNIQUE_MNT_ID))
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 113 return -EINVAL;
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 114
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 115 lookup_flags = (flag & AT_SYMLINK_FOLLOW) ? LOOKUP_FOLLOW : 0;
96b2b072ee62be Amir Goldstein 2023-05-02 116 fh_flags = (flag & AT_HANDLE_FID) ? EXPORT_FH_FID : 0;
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 117 if (flag & AT_EMPTY_PATH)
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 118 lookup_flags |= LOOKUP_EMPTY;
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 119 err = user_path_at(dfd, name, lookup_flags, &path);
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 120 if (!err) {
1702d25fd14170 Aleksa Sarai 2024-05-20 121 err = do_sys_name_to_handle(&path, handle, mnt_id,
1702d25fd14170 Aleksa Sarai 2024-05-20 122 flag & AT_HANDLE_UNIQUE_MNT_ID,
1702d25fd14170 Aleksa Sarai 2024-05-20 123 fh_flags);
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 124 path_put(&path);
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 125 }
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 126 return err;
990d6c2d7aee92 Aneesh Kumar K.V 2011-01-29 127 }
becfd1f3754479 Aneesh Kumar K.V 2011-01-29 128

--
0-DAY CI Kernel Test Service