Re: [PATCH 1/3] Change inode_operations.mkdir to return struct dentry *

kernel test robot
2025-02-17T15:58:59Z

Hi NeilBrown,

kernel test robot noticed the following build warnings:

[auto build test WARNING on brauner-vfs/vfs.all]
[also build test WARNING on trondmy-nfs/linux-next driver-core/driver-core-testing driver-core/driver-core-next driver-core/driver-core-linus cifs/for-next xfs-linux/for-next linus/master v6.14-rc3 next-20250217]
[cannot apply to ericvh-v9fs/for-next tyhicks-ecryptfs/next]
[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/NeilBrown/nfs-change-mkdir-inode_operation-to-return-alternate-dentry-if-needed/20250214-141741
base: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link: https://lore.kernel.org/r/20250214052204.3105610-2-neilb%40suse.de
patch subject: [PATCH 1/3] Change inode_operations.mkdir to return struct dentry *
config: um-randconfig-r122-20250217 (https://download.01.org/0day-ci/archive/20250217/202502172326.hdZnGqWS-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250217/202502172326.hdZnGqWS-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/202502172326.hdZnGqWS-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> fs/hostfs/hostfs_kern.c:689:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected struct dentry * @@ got int @@
fs/hostfs/hostfs_kern.c:689:24: sparse: expected struct dentry *
fs/hostfs/hostfs_kern.c:689:24: sparse: got int

vim +689 fs/hostfs/hostfs_kern.c

^1da177e4c3f41 Linus Torvalds 2005-04-16 681
456289e0bd14ce NeilBrown 2025-02-14 682 static struct dentry *hostfs_mkdir(struct mnt_idmap *idmap, struct inode *ino,
549c7297717c32 Christian Brauner 2021-01-21 683 struct dentry *dentry, umode_t mode)
^1da177e4c3f41 Linus Torvalds 2005-04-16 684 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 685 char *file;
^1da177e4c3f41 Linus Torvalds 2005-04-16 686 int err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 687
c5322220eb91b9 Al Viro 2010-06-06 688 if ((file = dentry_name(dentry)) == NULL)
f1adc05e773830 Jeff Dike 2007-05-08 @689 return -ENOMEM;
^1da177e4c3f41 Linus Torvalds 2005-04-16 690 err = do_mkdir(file, mode);
e9193059b1b373 Al Viro 2010-06-06 691 __putname(file);
456289e0bd14ce NeilBrown 2025-02-14 692 if (err)
456289e0bd14ce NeilBrown 2025-02-14 693 return ERR_PTR(err);
456289e0bd14ce NeilBrown 2025-02-14 694 else
456289e0bd14ce NeilBrown 2025-02-14 695 return dentry;
^1da177e4c3f41 Linus Torvalds 2005-04-16 696 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 697

--
0-DAY CI Kernel Test Service