Re: [PATCH 5/7] f2fs: separate the options parsing and options checking

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

 



Hi Eric,

kernel test robot noticed the following build errors:

[auto build test ERROR on v6.15-rc3]
[also build test ERROR on linus/master]
[cannot apply to jaegeuk-f2fs/dev-test jaegeuk-f2fs/dev next-20250417]
[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/Eric-Sandeen/f2fs-Add-fs-parameter-specifications-for-mount-options/20250421-220156
base:   v6.15-rc3
patch link:    https://lore.kernel.org/r/20250420154647.1233033-6-sandeen%40redhat.com
patch subject: [PATCH 5/7] f2fs: separate the options parsing and options checking
config: i386-buildonly-randconfig-005-20250421 (https://download.01.org/0day-ci/archive/20250422/202504220139.19wajgtO-lkp@xxxxxxxxx/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/20250422/202504220139.19wajgtO-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504220139.19wajgtO-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from include/linux/printk.h:7,
                    from include/linux/kernel.h:31,
                    from include/linux/cpumask.h:11,
                    from arch/x86/include/asm/cpumask.h:5,
                    from arch/x86/include/asm/msr.h:11,
                    from arch/x86/include/asm/tsc.h:10,
                    from arch/x86/include/asm/timex.h:6,
                    from include/linux/timex.h:67,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from fs/f2fs/super.c:8:
   fs/f2fs/super.c: In function 'handle_mount_opt':
   include/linux/kern_levels.h:5:25: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' [-Wformat=]
       5 | #define KERN_SOH        "\001"          /* ASCII Start Of Header */
         |                         ^~~~~~
   include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH'
      11 | #define KERN_ERR        KERN_SOH "3"    /* error conditions */
         |                         ^~~~~~~~
   fs/f2fs/f2fs.h:1871:33: note: in expansion of macro 'KERN_ERR'
    1871 |         f2fs_printk(sbi, false, KERN_ERR fmt, ##__VA_ARGS__)
         |                                 ^~~~~~~~
   fs/f2fs/super.c:763:25: note: in expansion of macro 'f2fs_err'
     763 |                         f2fs_err(NULL, "inline xattr size is out of range: %lu ~ %lu",
         |                         ^~~~~~~~
   fs/f2fs/super.c: In function 'f2fs_check_quota_consistency':
>> fs/f2fs/super.c:1285:27: error: 'sbi' undeclared (first use in this function); did you mean 'sb'?
    1285 |         if (f2fs_readonly(sbi->sb))
         |                           ^~~
         |                           sb
   fs/f2fs/super.c:1285:27: note: each undeclared identifier is reported only once for each function it appears in


vim +1285 fs/f2fs/super.c

  1182	
  1183	/*
  1184	 * Check quota settings consistency.
  1185	 */
  1186	static int f2fs_check_quota_consistency(struct fs_context *fc,
  1187						struct super_block *sb)
  1188	{
  1189	 #ifdef CONFIG_QUOTA
  1190		struct f2fs_fs_context *ctx = fc->fs_private;
  1191		struct f2fs_sb_info *sbi = F2FS_SB(sb);
  1192		bool quota_feature = f2fs_sb_has_quota_ino(sbi);
  1193		bool quota_turnon = sb_any_quota_loaded(sb);
  1194		char *old_qname, *new_qname;
  1195		bool usr_qf_name, grp_qf_name, prj_qf_name, usrquota, grpquota, prjquota;
  1196		int i;
  1197	
  1198		/*
  1199		 * We do the test below only for project quotas. 'usrquota' and
  1200		 * 'grpquota' mount options are allowed even without quota feature
  1201		 * to support legacy quotas in quota files.
  1202		 */
  1203		if (ctx_test_opt(ctx, F2FS_MOUNT_PRJQUOTA) &&
  1204				!f2fs_sb_has_project_quota(sbi)) {
  1205			f2fs_err(sbi, "Project quota feature not enabled. Cannot enable project quota enforcement.");
  1206			return -EINVAL;
  1207		}
  1208	
  1209		if (ctx->qname_mask) {
  1210			for (i = 0; i < MAXQUOTAS; i++) {
  1211				if (!(ctx->qname_mask & (1 << i)))
  1212					continue;
  1213	
  1214				old_qname = F2FS_OPTION(sbi).s_qf_names[i];
  1215				new_qname = F2FS_CTX_INFO(ctx).s_qf_names[i];
  1216				if (quota_turnon &&
  1217					!!old_qname != !!new_qname)
  1218					goto err_jquota_change;
  1219	
  1220				if (old_qname) {
  1221					if (strcmp(old_qname, new_qname) == 0) {
  1222						ctx->qname_mask &= ~(1 << i);
  1223						continue;
  1224					}
  1225					goto err_jquota_specified;
  1226				}
  1227	
  1228				if (quota_feature) {
  1229					f2fs_info(sbi, "QUOTA feature is enabled, so ignore qf_name");
  1230					ctx->qname_mask &= ~(1 << i);
  1231					kfree(F2FS_CTX_INFO(ctx).s_qf_names[i]);
  1232					F2FS_CTX_INFO(ctx).s_qf_names[i] = NULL;
  1233				}
  1234			}
  1235		}
  1236	
  1237		/* Make sure we don't mix old and new quota format */
  1238		usr_qf_name = F2FS_OPTION(sbi).s_qf_names[USRQUOTA] ||
  1239				F2FS_CTX_INFO(ctx).s_qf_names[USRQUOTA];
  1240		grp_qf_name = F2FS_OPTION(sbi).s_qf_names[GRPQUOTA] ||
  1241				F2FS_CTX_INFO(ctx).s_qf_names[GRPQUOTA];
  1242		prj_qf_name = F2FS_OPTION(sbi).s_qf_names[PRJQUOTA] ||
  1243				F2FS_CTX_INFO(ctx).s_qf_names[PRJQUOTA];
  1244		usrquota = test_opt(sbi, USRQUOTA) ||
  1245				ctx_test_opt(ctx, F2FS_MOUNT_USRQUOTA);
  1246		grpquota = test_opt(sbi, GRPQUOTA) ||
  1247				ctx_test_opt(ctx, F2FS_MOUNT_GRPQUOTA);
  1248		prjquota = test_opt(sbi, PRJQUOTA) ||
  1249				ctx_test_opt(ctx, F2FS_MOUNT_PRJQUOTA);
  1250	
  1251		if (usr_qf_name) {
  1252			ctx_clear_opt(ctx, F2FS_MOUNT_USRQUOTA);
  1253			usrquota = false;
  1254		}
  1255		if (grp_qf_name) {
  1256			ctx_clear_opt(ctx, F2FS_MOUNT_GRPQUOTA);
  1257			grpquota = false;
  1258		}
  1259		if (prj_qf_name) {
  1260			ctx_clear_opt(ctx, F2FS_MOUNT_PRJQUOTA);
  1261			prjquota = false;
  1262		}
  1263		if (usr_qf_name || grp_qf_name || prj_qf_name) {
  1264			if (grpquota || usrquota || prjquota) {
  1265				f2fs_err(sbi, "old and new quota format mixing");
  1266				return -EINVAL;
  1267			}
  1268			if (!(ctx->spec_mask & F2FS_SPEC_jqfmt ||
  1269					F2FS_OPTION(sbi).s_jquota_fmt)) {
  1270				f2fs_err(sbi, "journaled quota format not specified");
  1271				return -EINVAL;
  1272			}
  1273		}
  1274		return 0;
  1275	
  1276	err_jquota_change:
  1277		f2fs_err(sbi, "Cannot change journaled quota options when quota turned on");
  1278		return -EINVAL;
  1279	err_jquota_specified:
  1280		f2fs_err(sbi, "%s quota file already specified",
  1281			 QTYPE2NAME(i));
  1282		return -EINVAL;
  1283	
  1284	#else
> 1285		if (f2fs_readonly(sbi->sb))
  1286			return 0;
  1287		if (f2fs_sb_has_quota_ino(sbi)) {
  1288			f2fs_info(sbi, "Filesystem with quota feature cannot be mounted RDWR without CONFIG_QUOTA");
  1289			return -EINVAL;
  1290		}
  1291		if (f2fs_sb_has_project_quota(sbi)) {
  1292			f2fs_err(sbi, "Filesystem with project quota feature cannot be mounted RDWR without CONFIG_QUOTA");
  1293			return -EINVAL;
  1294		}
  1295	
  1296		return 0;
  1297	#endif
  1298	}
  1299	

-- 
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