Re: [PATCH 1/2] fat: Add FS_IOC_GETFSLABEL ioctl

From: Dan Carpenter

Date: Wed Feb 11 2026 - 05:58:20 EST


Hi Ethan,

kernel test robot noticed the following build warnings:

url: https://github.com/intel-lab-lkp/linux/commits/Ethan-Ferguson/fat-Add-FS_IOC_GETFSLABEL-ioctl/20260211-062606
base: 9f2693489ef8558240d9e80bfad103650daed0af
patch link: https://lore.kernel.org/r/20260210222310.357755-2-ethan.ferguson%40zetier.com
patch subject: [PATCH 1/2] fat: Add FS_IOC_GETFSLABEL ioctl
config: riscv-randconfig-r071-20260211 (https://download.01.org/0day-ci/archive/20260211/202602111747.QIBXIwpw-lkp@xxxxxxxxx/config)
compiler: riscv64-linux-gcc (GCC) 9.5.0
smatch version: v0.5.0-8994-gd50c5a4c

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>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202602111747.QIBXIwpw-lkp@xxxxxxxxx/

smatch warnings:
fs/fat/file.c:160 fat_ioctl_get_volume_label() warn: maybe return -EFAULT instead of the bytes remaining?

vim +160 fs/fat/file.c

5fc1746d68b8fb Ethan Ferguson 2026-02-10 156 static int fat_ioctl_get_volume_label(struct inode *inode, char __user *arg)
5fc1746d68b8fb Ethan Ferguson 2026-02-10 157 {
5fc1746d68b8fb Ethan Ferguson 2026-02-10 158 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
5fc1746d68b8fb Ethan Ferguson 2026-02-10 159
5fc1746d68b8fb Ethan Ferguson 2026-02-10 @160 return copy_to_user(arg, sbi->vol_label, MSDOS_NAME);

This should be:

if (copy_to_user(arg, sbi->vol_label, MSDOS_NAME))
return -EFAULT;

return 0;

5fc1746d68b8fb Ethan Ferguson 2026-02-10 161 }

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