public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ye Bin <yebin@huaweicloud.com>,
	tytso@mit.edu, adilger.kernel@dilger.ca,
	linux-ext4@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, jack@suse.cz
Subject: Re: [PATCH -next 1/8] ext4: fix mballoc-test.c is not compiled when EXT4_KUNIT_TESTS=M
Date: Wed, 11 Mar 2026 10:44:45 +0800	[thread overview]
Message-ID: <202603111026.Utt3pe7W-lkp@intel.com> (raw)
In-Reply-To: <20260310130412.3156753-2-yebin@huaweicloud.com>

Hi Ye,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20260309]

url:    https://github.com/intel-lab-lkp/linux/commits/Ye-Bin/ext4-fix-mballoc-test-c-is-not-compiled-when-EXT4_KUNIT_TESTS-M/20260310-225016
base:   next-20260309
patch link:    https://lore.kernel.org/r/20260310130412.3156753-2-yebin%40huaweicloud.com
patch subject: [PATCH -next 1/8] ext4: fix mballoc-test.c is not compiled when EXT4_KUNIT_TESTS=M
config: sh-defconfig (https://download.01.org/0day-ci/archive/20260311/202603111026.Utt3pe7W-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260311/202603111026.Utt3pe7W-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/202603111026.Utt3pe7W-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ext4/mballoc.c:4088:1: warning: no previous prototype for 'ext4_mb_mark_context' [-Wmissing-prototypes]
    4088 | ext4_mb_mark_context(handle_t *handle, struct super_block *sb, bool state,
         | ^~~~~~~~~~~~~~~~~~~~


vim +/ext4_mb_mark_context +4088 fs/ext4/mballoc.c

c9de560ded61faa Alex Tomas 2008-01-29  4084  
c431d3867e0a825 Kemeng Shi 2023-09-29  4085  #define EXT4_MB_BITMAP_MARKED_CHECK 0x0001
c431d3867e0a825 Kemeng Shi 2023-09-29  4086  #define EXT4_MB_SYNC_UPDATE 0x0002
74bd22ec0285256 Ye Bin     2026-03-10  4087  int
c431d3867e0a825 Kemeng Shi 2023-09-29 @4088  ext4_mb_mark_context(handle_t *handle, struct super_block *sb, bool state,
c431d3867e0a825 Kemeng Shi 2023-09-29  4089  		     ext4_group_t group, ext4_grpblk_t blkoff,
c431d3867e0a825 Kemeng Shi 2023-09-29  4090  		     ext4_grpblk_t len, int flags, ext4_grpblk_t *ret_changed)
f9e2d95a4532185 Kemeng Shi 2023-09-29  4091  {
f9e2d95a4532185 Kemeng Shi 2023-09-29  4092  	struct ext4_sb_info *sbi = EXT4_SB(sb);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4093  	struct buffer_head *bitmap_bh = NULL;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4094  	struct ext4_group_desc *gdp;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4095  	struct buffer_head *gdp_bh;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4096  	int err;
c431d3867e0a825 Kemeng Shi 2023-09-29  4097  	unsigned int i, already, changed = len;
bdefd689b7ff0ea Kemeng Shi 2023-09-29  4098  
bdefd689b7ff0ea Kemeng Shi 2023-09-29  4099  	KUNIT_STATIC_STUB_REDIRECT(ext4_mb_mark_context,
bdefd689b7ff0ea Kemeng Shi 2023-09-29  4100  				   handle, sb, state, group, blkoff, len,
bdefd689b7ff0ea Kemeng Shi 2023-09-29  4101  				   flags, ret_changed);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4102  
c431d3867e0a825 Kemeng Shi 2023-09-29  4103  	if (ret_changed)
c431d3867e0a825 Kemeng Shi 2023-09-29  4104  		*ret_changed = 0;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4105  	bitmap_bh = ext4_read_block_bitmap(sb, group);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4106  	if (IS_ERR(bitmap_bh))
f9e2d95a4532185 Kemeng Shi 2023-09-29  4107  		return PTR_ERR(bitmap_bh);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4108  
c431d3867e0a825 Kemeng Shi 2023-09-29  4109  	if (handle) {
c431d3867e0a825 Kemeng Shi 2023-09-29  4110  		BUFFER_TRACE(bitmap_bh, "getting write access");
c431d3867e0a825 Kemeng Shi 2023-09-29  4111  		err = ext4_journal_get_write_access(handle, sb, bitmap_bh,
c431d3867e0a825 Kemeng Shi 2023-09-29  4112  						    EXT4_JTR_NONE);
c431d3867e0a825 Kemeng Shi 2023-09-29  4113  		if (err)
c431d3867e0a825 Kemeng Shi 2023-09-29  4114  			goto out_err;
c431d3867e0a825 Kemeng Shi 2023-09-29  4115  	}
c431d3867e0a825 Kemeng Shi 2023-09-29  4116  
f9e2d95a4532185 Kemeng Shi 2023-09-29  4117  	err = -EIO;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4118  	gdp = ext4_get_group_desc(sb, group, &gdp_bh);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4119  	if (!gdp)
f9e2d95a4532185 Kemeng Shi 2023-09-29  4120  		goto out_err;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4121  
c431d3867e0a825 Kemeng Shi 2023-09-29  4122  	if (handle) {
c431d3867e0a825 Kemeng Shi 2023-09-29  4123  		BUFFER_TRACE(gdp_bh, "get_write_access");
c431d3867e0a825 Kemeng Shi 2023-09-29  4124  		err = ext4_journal_get_write_access(handle, sb, gdp_bh,
c431d3867e0a825 Kemeng Shi 2023-09-29  4125  						    EXT4_JTR_NONE);
c431d3867e0a825 Kemeng Shi 2023-09-29  4126  		if (err)
c431d3867e0a825 Kemeng Shi 2023-09-29  4127  			goto out_err;
c431d3867e0a825 Kemeng Shi 2023-09-29  4128  	}
c431d3867e0a825 Kemeng Shi 2023-09-29  4129  
f9e2d95a4532185 Kemeng Shi 2023-09-29  4130  	ext4_lock_group(sb, group);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4131  	if (ext4_has_group_desc_csum(sb) &&
f9e2d95a4532185 Kemeng Shi 2023-09-29  4132  	    (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))) {
f9e2d95a4532185 Kemeng Shi 2023-09-29  4133  		gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4134  		ext4_free_group_clusters_set(sb, gdp,
f9e2d95a4532185 Kemeng Shi 2023-09-29  4135  			ext4_free_clusters_after_init(sb, group, gdp));
f9e2d95a4532185 Kemeng Shi 2023-09-29  4136  	}
f9e2d95a4532185 Kemeng Shi 2023-09-29  4137  
c431d3867e0a825 Kemeng Shi 2023-09-29  4138  	if (flags & EXT4_MB_BITMAP_MARKED_CHECK) {
f9e2d95a4532185 Kemeng Shi 2023-09-29  4139  		already = 0;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4140  		for (i = 0; i < len; i++)
f9e2d95a4532185 Kemeng Shi 2023-09-29  4141  			if (mb_test_bit(blkoff + i, bitmap_bh->b_data) ==
f9e2d95a4532185 Kemeng Shi 2023-09-29  4142  					state)
f9e2d95a4532185 Kemeng Shi 2023-09-29  4143  				already++;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4144  		changed = len - already;
c431d3867e0a825 Kemeng Shi 2023-09-29  4145  	}
f9e2d95a4532185 Kemeng Shi 2023-09-29  4146  
f9e2d95a4532185 Kemeng Shi 2023-09-29  4147  	if (state) {
f9e2d95a4532185 Kemeng Shi 2023-09-29  4148  		mb_set_bits(bitmap_bh->b_data, blkoff, len);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4149  		ext4_free_group_clusters_set(sb, gdp,
f9e2d95a4532185 Kemeng Shi 2023-09-29  4150  			ext4_free_group_clusters(sb, gdp) - changed);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4151  	} else {
f9e2d95a4532185 Kemeng Shi 2023-09-29  4152  		mb_clear_bits(bitmap_bh->b_data, blkoff, len);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4153  		ext4_free_group_clusters_set(sb, gdp,
f9e2d95a4532185 Kemeng Shi 2023-09-29  4154  			ext4_free_group_clusters(sb, gdp) + changed);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4155  	}
f9e2d95a4532185 Kemeng Shi 2023-09-29  4156  
f9e2d95a4532185 Kemeng Shi 2023-09-29  4157  	ext4_block_bitmap_csum_set(sb, gdp, bitmap_bh);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4158  	ext4_group_desc_csum_set(sb, group, gdp);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4159  	ext4_unlock_group(sb, group);
c431d3867e0a825 Kemeng Shi 2023-09-29  4160  	if (ret_changed)
c431d3867e0a825 Kemeng Shi 2023-09-29  4161  		*ret_changed = changed;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4162  
f9e2d95a4532185 Kemeng Shi 2023-09-29  4163  	if (sbi->s_log_groups_per_flex) {
f9e2d95a4532185 Kemeng Shi 2023-09-29  4164  		ext4_group_t flex_group = ext4_flex_group(sbi, group);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4165  		struct flex_groups *fg = sbi_array_rcu_deref(sbi,
f9e2d95a4532185 Kemeng Shi 2023-09-29  4166  					   s_flex_groups, flex_group);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4167  
f9e2d95a4532185 Kemeng Shi 2023-09-29  4168  		if (state)
f9e2d95a4532185 Kemeng Shi 2023-09-29  4169  			atomic64_sub(changed, &fg->free_clusters);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4170  		else
f9e2d95a4532185 Kemeng Shi 2023-09-29  4171  			atomic64_add(changed, &fg->free_clusters);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4172  	}
f9e2d95a4532185 Kemeng Shi 2023-09-29  4173  
c431d3867e0a825 Kemeng Shi 2023-09-29  4174  	err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4175  	if (err)
f9e2d95a4532185 Kemeng Shi 2023-09-29  4176  		goto out_err;
c431d3867e0a825 Kemeng Shi 2023-09-29  4177  	err = ext4_handle_dirty_metadata(handle, NULL, gdp_bh);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4178  	if (err)
f9e2d95a4532185 Kemeng Shi 2023-09-29  4179  		goto out_err;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4180  
c431d3867e0a825 Kemeng Shi 2023-09-29  4181  	if (flags & EXT4_MB_SYNC_UPDATE) {
f9e2d95a4532185 Kemeng Shi 2023-09-29  4182  		sync_dirty_buffer(bitmap_bh);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4183  		sync_dirty_buffer(gdp_bh);
c431d3867e0a825 Kemeng Shi 2023-09-29  4184  	}
f9e2d95a4532185 Kemeng Shi 2023-09-29  4185  
f9e2d95a4532185 Kemeng Shi 2023-09-29  4186  out_err:
f9e2d95a4532185 Kemeng Shi 2023-09-29  4187  	brelse(bitmap_bh);
f9e2d95a4532185 Kemeng Shi 2023-09-29  4188  	return err;
f9e2d95a4532185 Kemeng Shi 2023-09-29  4189  }
c9de560ded61faa Alex Tomas 2008-01-29  4190  

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

  reply	other threads:[~2026-03-11  2:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 13:04 [PATCH -next 0/8] Fix some issues about ext4-test Ye Bin
2026-03-10 13:04 ` [PATCH -next 1/8] ext4: fix mballoc-test.c is not compiled when EXT4_KUNIT_TESTS=M Ye Bin
2026-03-11  2:44   ` kernel test robot [this message]
2026-03-11  3:26   ` kernel test robot
2026-03-10 13:04 ` [PATCH -next 2/8] ext4: introduce EXPORT_SYMBOL_FOR_EXT4_TEST() helper Ye Bin
2026-03-10 13:04 ` [PATCH -next 3/8] ext4: fix extents-test.c is not compiled when EXT4_KUNIT_TESTS=M Ye Bin
2026-03-11  6:32   ` kernel test robot
2026-03-10 13:04 ` [PATCH -next 4/8] ext4: fix miss unlock 'sb->s_umount' in extents_kunit_init() Ye Bin
2026-03-13 11:32   ` Ritesh Harjani
2026-03-10 13:04 ` [PATCH -next 5/8] ext4: fix miss free super_block in extents_kunit_exit() Ye Bin
2026-03-13 12:03   ` Ritesh Harjani
2026-03-13 14:03     ` Ojaswin Mujoo
2026-03-10 13:04 ` [PATCH -next 6/8] ext4: fix the error handling process in extents_kunit_init) Ye Bin
2026-03-13 12:15   ` Ritesh Harjani
2026-03-14  2:21     ` yebin (H)
2026-03-10 13:04 ` [PATCH -next 7/8] ext4: fix possible null-ptr-deref in extents_kunit_exit() Ye Bin
2026-03-13 12:27   ` Ritesh Harjani
2026-03-10 13:04 ` [PATCH -next 8/8] ext4: fix possible null-ptr-deref in mbt_kunit_exit() Ye Bin
2026-03-13 12:33   ` Ritesh Harjani
2026-03-13  7:16 ` [PATCH -next 0/8] Fix some issues about ext4-test Ojaswin Mujoo
2026-03-13 10:34   ` Ojaswin Mujoo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202603111026.Utt3pe7W-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tytso@mit.edu \
    --cc=yebin@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox