Re: [PATCH v5] block: support mtd:<name> syntax for block devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joakim,

kernel test robot noticed the following build warnings:

[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on linus/master v6.15 next-20250528]
[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/Joakim-Tjernlund/block-support-mtd-name-syntax-for-block-devices/20250527-231359
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link:    https://lore.kernel.org/r/20250527151134.566571-1-joakim.tjernlund%40infinera.com
patch subject: [PATCH v5] block: support mtd:<name> syntax for block devices
config: i386-randconfig-141-20250528 (https://download.01.org/0day-ci/archive/20250528/202505282035.6vfhJHYl-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)

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/202505282035.6vfhJHYl-lkp@xxxxxxxxx/

smatch warnings:
block/bdev.c:1097 bdev_file_open_by_path() warn: inconsistent indenting

vim +1097 block/bdev.c

f3a608827d1f8d Christian Brauner 2024-02-08  1070  
f3a608827d1f8d Christian Brauner 2024-02-08  1071  struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,
f3a608827d1f8d Christian Brauner 2024-02-08  1072  				    void *holder,
f3a608827d1f8d Christian Brauner 2024-02-08  1073  				    const struct blk_holder_ops *hops)
f3a608827d1f8d Christian Brauner 2024-02-08  1074  {
7c09a4ed6156c6 Christian Brauner 2024-01-23  1075  	struct file *file;
f3a608827d1f8d Christian Brauner 2024-02-08  1076  	dev_t dev;
f3a608827d1f8d Christian Brauner 2024-02-08  1077  	int error;
f3a608827d1f8d Christian Brauner 2024-02-08  1078  
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1079  #ifdef CONFIG_MTD_BLOCK
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1080         if (!strncmp(path, "mtd:", 4)) {
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1081                 struct mtd_info *mtd;
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1082  
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1083                 /* mount by MTD device name */
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1084                 pr_debug("path name \"%s\"\n", path);
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1085                 mtd = get_mtd_device_nm(path + 4);
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1086                 if (IS_ERR(mtd))
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1087                         return ERR_PTR(-EINVAL);
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1088                 dev = MKDEV(MTD_BLOCK_MAJOR, mtd->index);
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1089         } else
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1090  #endif
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1091         {
f3a608827d1f8d Christian Brauner 2024-02-08  1092  	       error = lookup_bdev(path, &dev);
f3a608827d1f8d Christian Brauner 2024-02-08  1093  	       if (error)
f3a608827d1f8d Christian Brauner 2024-02-08  1094  		       return ERR_PTR(error);
e02c700b2107f3 Joakim Tjernlund  2025-05-27  1095         }
f3a608827d1f8d Christian Brauner 2024-02-08  1096  
7c09a4ed6156c6 Christian Brauner 2024-01-23 @1097  	file = bdev_file_open_by_dev(dev, mode, holder, hops);
7c09a4ed6156c6 Christian Brauner 2024-01-23  1098  	if (!IS_ERR(file) && (mode & BLK_OPEN_WRITE)) {
7c09a4ed6156c6 Christian Brauner 2024-01-23  1099  		if (bdev_read_only(file_bdev(file))) {
7c09a4ed6156c6 Christian Brauner 2024-01-23  1100  			fput(file);
7c09a4ed6156c6 Christian Brauner 2024-01-23  1101  			file = ERR_PTR(-EACCES);
f3a608827d1f8d Christian Brauner 2024-02-08  1102  		}
f3a608827d1f8d Christian Brauner 2024-02-08  1103  	}
f3a608827d1f8d Christian Brauner 2024-02-08  1104  
7c09a4ed6156c6 Christian Brauner 2024-01-23  1105  	return file;
f3a608827d1f8d Christian Brauner 2024-02-08  1106  }
f3a608827d1f8d Christian Brauner 2024-02-08  1107  EXPORT_SYMBOL(bdev_file_open_by_path);
f3a608827d1f8d Christian Brauner 2024-02-08  1108  

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux