Re: [PATCH v9 7/9] ext4: fast commit recovery path

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

 



Hi Harshad,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on ext4/dev]
[also build test WARNING on linus/master v5.9-rc5 next-20200918]
[cannot apply to tip/perf/core]
[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]

url:    https://github.com/0day-ci/linux/commits/Harshad-Shirwadkar/ext4-add-fast-commits-feature/20200919-085652
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
config: x86_64-randconfig-a006-20200917 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ed79827aea444e6995fb3d36abc2bfd36331773c)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> fs/ext4/mballoc.c:5226:6: warning: no previous prototype for function 'ext4_free_blocks_simple' [-Wmissing-prototypes]
   void ext4_free_blocks_simple(struct inode *inode, ext4_fsblk_t block,
        ^
   fs/ext4/mballoc.c:5226:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void ext4_free_blocks_simple(struct inode *inode, ext4_fsblk_t block,
   ^
   static 
   1 warning generated.
--
   fs/ext4/fast_commit.c:1091:6: warning: variable 'start_time' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/fast_commit.c:1147:51: note: uninitialized use occurs here
           commit_time = ktime_to_ns(ktime_sub(ktime_get(), start_time));
                                                            ^~~~~~~~~~
   include/linux/ktime.h:46:39: note: expanded from macro 'ktime_sub'
   #define ktime_sub(lhs, rhs)     ((lhs) - (rhs))
                                             ^~~
   fs/ext4/fast_commit.c:1091:2: note: remove the 'if' if its condition is always false
           if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/fast_commit.c:1091:6: warning: variable 'start_time' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
           if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/fast_commit.c:1147:51: note: uninitialized use occurs here
           commit_time = ktime_to_ns(ktime_sub(ktime_get(), start_time));
                                                            ^~~~~~~~~~
   include/linux/ktime.h:46:39: note: expanded from macro 'ktime_sub'
   #define ktime_sub(lhs, rhs)     ((lhs) - (rhs))
                                             ^~~
   fs/ext4/fast_commit.c:1091:6: note: remove the '||' if its condition is always false
           if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/ext4/fast_commit.c:1087:20: note: initialize the variable 'start_time' to silence this warning
           ktime_t start_time, commit_time;
                             ^
                              = 0
>> fs/ext4/fast_commit.c:1787:6: warning: no previous prototype for function 'ext4_fc_set_bitmaps_and_counters' [-Wmissing-prototypes]
   void ext4_fc_set_bitmaps_and_counters(struct super_block *sb)
        ^
   fs/ext4/fast_commit.c:1787:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void ext4_fc_set_bitmaps_and_counters(struct super_block *sb)
   ^
   static 
   3 warnings generated.

# https://github.com/0day-ci/linux/commit/e027573763bf3d778cd1c279f9b08698817c00f1
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Harshad-Shirwadkar/ext4-add-fast-commits-feature/20200919-085652
git checkout e027573763bf3d778cd1c279f9b08698817c00f1
vim +/ext4_free_blocks_simple +5226 fs/ext4/mballoc.c

  5225	
> 5226	void ext4_free_blocks_simple(struct inode *inode, ext4_fsblk_t block,
  5227				     unsigned long count)
  5228	{
  5229		struct buffer_head *bitmap_bh;
  5230		struct super_block *sb = inode->i_sb;
  5231		struct ext4_group_desc *gdp;
  5232		struct buffer_head *gdp_bh;
  5233		ext4_group_t group;
  5234		ext4_grpblk_t blkoff;
  5235		int already_freed = 0, err, i;
  5236	
  5237		ext4_get_group_no_and_offset(sb, block, &group, &blkoff);
  5238		bitmap_bh = ext4_read_block_bitmap(sb, group);
  5239		if (IS_ERR(bitmap_bh)) {
  5240			err = PTR_ERR(bitmap_bh);
  5241			pr_warn("Failed to read block bitmap\n");
  5242			return;
  5243		}
  5244		gdp = ext4_get_group_desc(sb, group, &gdp_bh);
  5245		if (!gdp)
  5246			return;
  5247	
  5248		for (i = 0; i < count; i++) {
  5249			if (!mb_test_bit(blkoff + i, bitmap_bh->b_data))
  5250				already_freed++;
  5251		}
  5252		mb_clear_bits(bitmap_bh->b_data, blkoff, count);
  5253		err = ext4_handle_dirty_metadata(NULL, NULL, bitmap_bh);
  5254		if (err)
  5255			return;
  5256		ext4_free_group_clusters_set(
  5257			sb, gdp, ext4_free_group_clusters(sb, gdp) +
  5258			count - already_freed);
  5259		ext4_block_bitmap_csum_set(sb, group, gdp, bitmap_bh);
  5260		ext4_group_desc_csum_set(sb, group, gdp);
  5261		ext4_handle_dirty_metadata(NULL, NULL, gdp_bh);
  5262		sync_dirty_buffer(bitmap_bh);
  5263		sync_dirty_buffer(gdp_bh);
  5264		brelse(bitmap_bh);
  5265	}
  5266	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux