lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202408290407.XQuWf1oH-lkp@intel.com>
Date: Thu, 29 Aug 2024 05:34:09 +0800
From: kernel test robot <lkp@...el.com>
To: Li Zetao <lizetao1@...wei.com>, tytso@....edu, adilger.kernel@...ger.ca
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	lizetao1@...wei.com, linux-ext4@...r.kernel.org
Subject: Re: [PATCH -next 3/3] ext4: Use scoped()/scoped_guard() to drop
 rcu_read_lock()/unlock pair

Hi Li,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20240823]

url:    https://github.com/intel-lab-lkp/linux/commits/Li-Zetao/ext4-Use-scoped-scoped_guard-to-drop-read_lock-unlock-pair/20240826-123331
base:   next-20240823
patch link:    https://lore.kernel.org/r/20240823061824.3323522-4-lizetao1%40huawei.com
patch subject: [PATCH -next 3/3] ext4: Use scoped()/scoped_guard() to drop rcu_read_lock()/unlock pair
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20240829/202408290407.XQuWf1oH-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 08e5a1de8227512d4774a534b91cb2353cef6284)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240829/202408290407.XQuWf1oH-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408290407.XQuWf1oH-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from fs/ext4/mballoc.c:12:
   In file included from fs/ext4/ext4_jbd2.h:16:
   In file included from include/linux/jbd2.h:23:
   In file included from include/linux/buffer_head.h:12:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/mm.h:2202:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> fs/ext4/mballoc.c:3470:2: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
    3470 |         guard(rcu)();
         |         ^
   include/linux/cleanup.h:303:2: note: expanded from macro 'guard'
     303 |         CLASS(_name, __UNIQUE_ID(guard))
         |         ^
   include/linux/cleanup.h:258:2: note: expanded from macro 'CLASS'
     258 |         class_##_name##_t var __cleanup(class_##_name##_destructor) =   \
         |         ^
   <scratch space>:94:1: note: expanded from here
      94 | class_rcu_t
         | ^
   5 warnings generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for OMAP2PLUS_MBOX
   Depends on [n]: MAILBOX [=y] && (ARCH_OMAP2PLUS || ARCH_K3)
   Selected by [m]:
   - TI_K3_M4_REMOTEPROC [=m] && REMOTEPROC [=y] && (ARCH_K3 || COMPILE_TEST [=y])


vim +3470 fs/ext4/mballoc.c

  3386	
  3387	static int ext4_mb_init_backend(struct super_block *sb)
  3388	{
  3389		ext4_group_t ngroups = ext4_get_groups_count(sb);
  3390		ext4_group_t i;
  3391		struct ext4_sb_info *sbi = EXT4_SB(sb);
  3392		int err;
  3393		struct ext4_group_desc *desc;
  3394		struct ext4_group_info ***group_info;
  3395		struct kmem_cache *cachep;
  3396	
  3397		err = ext4_mb_alloc_groupinfo(sb, ngroups);
  3398		if (err)
  3399			return err;
  3400	
  3401		sbi->s_buddy_cache = new_inode(sb);
  3402		if (sbi->s_buddy_cache == NULL) {
  3403			ext4_msg(sb, KERN_ERR, "can't get new inode");
  3404			goto err_freesgi;
  3405		}
  3406		/* To avoid potentially colliding with an valid on-disk inode number,
  3407		 * use EXT4_BAD_INO for the buddy cache inode number.  This inode is
  3408		 * not in the inode hash, so it should never be found by iget(), but
  3409		 * this will avoid confusion if it ever shows up during debugging. */
  3410		sbi->s_buddy_cache->i_ino = EXT4_BAD_INO;
  3411		EXT4_I(sbi->s_buddy_cache)->i_disksize = 0;
  3412		for (i = 0; i < ngroups; i++) {
  3413			cond_resched();
  3414			desc = ext4_get_group_desc(sb, i, NULL);
  3415			if (desc == NULL) {
  3416				ext4_msg(sb, KERN_ERR, "can't read descriptor %u", i);
  3417				goto err_freebuddy;
  3418			}
  3419			if (ext4_mb_add_groupinfo(sb, i, desc) != 0)
  3420				goto err_freebuddy;
  3421		}
  3422	
  3423		if (ext4_has_feature_flex_bg(sb)) {
  3424			/* a single flex group is supposed to be read by a single IO.
  3425			 * 2 ^ s_log_groups_per_flex != UINT_MAX as s_mb_prefetch is
  3426			 * unsigned integer, so the maximum shift is 32.
  3427			 */
  3428			if (sbi->s_es->s_log_groups_per_flex >= 32) {
  3429				ext4_msg(sb, KERN_ERR, "too many log groups per flexible block group");
  3430				goto err_freebuddy;
  3431			}
  3432			sbi->s_mb_prefetch = min_t(uint, 1 << sbi->s_es->s_log_groups_per_flex,
  3433				BLK_MAX_SEGMENT_SIZE >> (sb->s_blocksize_bits - 9));
  3434			sbi->s_mb_prefetch *= 8; /* 8 prefetch IOs in flight at most */
  3435		} else {
  3436			sbi->s_mb_prefetch = 32;
  3437		}
  3438		if (sbi->s_mb_prefetch > ext4_get_groups_count(sb))
  3439			sbi->s_mb_prefetch = ext4_get_groups_count(sb);
  3440		/*
  3441		 * now many real IOs to prefetch within a single allocation at
  3442		 * CR_POWER2_ALIGNED. Given CR_POWER2_ALIGNED is an CPU-related
  3443		 * optimization we shouldn't try to load too many groups, at some point
  3444		 * we should start to use what we've got in memory.
  3445		 * with an average random access time 5ms, it'd take a second to get
  3446		 * 200 groups (* N with flex_bg), so let's make this limit 4
  3447		 */
  3448		sbi->s_mb_prefetch_limit = sbi->s_mb_prefetch * 4;
  3449		if (sbi->s_mb_prefetch_limit > ext4_get_groups_count(sb))
  3450			sbi->s_mb_prefetch_limit = ext4_get_groups_count(sb);
  3451	
  3452		return 0;
  3453	
  3454	err_freebuddy:
  3455		cachep = get_groupinfo_cache(sb->s_blocksize_bits);
  3456		while (i-- > 0) {
  3457			struct ext4_group_info *grp = ext4_get_group_info(sb, i);
  3458	
  3459			if (grp)
  3460				kmem_cache_free(cachep, grp);
  3461		}
  3462		i = sbi->s_group_info_size;
  3463		scoped_guard(rcu) {
  3464			group_info = rcu_dereference(sbi->s_group_info);
  3465			while (i-- > 0)
  3466				kfree(group_info[i]);
  3467		}
  3468		iput(sbi->s_buddy_cache);
  3469	err_freesgi:
> 3470		guard(rcu)();
  3471		kvfree(rcu_dereference(sbi->s_group_info));
  3472		return -ENOMEM;
  3473	}
  3474	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ