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>] [day] [month] [year] [list]
Message-ID: <202104100159.B2w6vxAi-lkp@intel.com>
Date:   Sat, 10 Apr 2021 01:36:06 +0800
From:   kernel test robot <lkp@...el.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     kbuild-all@...ts.01.org, linux-ext4@...r.kernel.org,
        Theodore Ts'o <tytso@....edu>, Jan Kara <jack@...e.cz>
Subject: [ext4:dev 9/17] fs/ext4/fast_commit.c:1737:16: warning: format '%d'
 expects argument of type 'int', but argument 2 has type 'long unsigned int'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
head:   21175ca434c5d49509b73cf473618b01b0b85437
commit: d556435156b7970b8ce61b355df558a5168927cc [9/17] jbd2: avoid -Wempty-body warnings
config: m68k-defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id=d556435156b7970b8ce61b355df558a5168927cc
        git remote add ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
        git fetch --no-tags ext4 dev
        git checkout d556435156b7970b8ce61b355df558a5168927cc
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:16,
                    from include/linux/list.h:9,
                    from include/linux/rculist.h:10,
                    from include/linux/pid.h:5,
                    from include/linux/sched.h:14,
                    from include/linux/blkdev.h:5,
                    from fs/ext4/ext4.h:21,
                    from fs/ext4/fast_commit.c:10:
   fs/ext4/fast_commit.c: In function 'ext4_fc_replay_add_range':
>> fs/ext4/fast_commit.c:1737:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long unsigned int' [-Wformat=]
    1737 |   jbd_debug(1, "Converting from %d to %d %lld",
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:140:10: note: in definition of macro 'no_printk'
     140 |   printk(fmt, ##__VA_ARGS__);  \
         |          ^~~
   fs/ext4/fast_commit.c:1737:3: note: in expansion of macro 'jbd_debug'
    1737 |   jbd_debug(1, "Converting from %d to %d %lld",
         |   ^~~~~~~~~
   fs/ext4/fast_commit.c:1737:34: note: format string is defined here
    1737 |   jbd_debug(1, "Converting from %d to %d %lld",
         |                                 ~^
         |                                  |
         |                                  int
         |                                 %ld
--
   In file included from include/linux/kernel.h:16,
                    from include/linux/list.h:9,
                    from include/linux/wait.h:7,
                    from include/linux/wait_bit.h:8,
                    from include/linux/fs.h:6,
                    from fs/jbd2/recovery.c:17:
   fs/jbd2/recovery.c: In function 'fc_do_one_pass':
>> fs/jbd2/recovery.c:256:16: warning: format '%d' expects a matching 'int' argument [-Wformat=]
     256 |   jbd_debug(3, "Processing fast commit blk with seq %d");
         |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:140:10: note: in definition of macro 'no_printk'
     140 |   printk(fmt, ##__VA_ARGS__);  \
         |          ^~~
   fs/jbd2/recovery.c:256:3: note: in expansion of macro 'jbd_debug'
     256 |   jbd_debug(3, "Processing fast commit blk with seq %d");
         |   ^~~~~~~~~
   fs/jbd2/recovery.c:256:54: note: format string is defined here
     256 |   jbd_debug(3, "Processing fast commit blk with seq %d");
         |                                                     ~^
         |                                                      |
         |                                                      int


vim +1737 fs/ext4/fast_commit.c

8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1631  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1632  /* Replay add range tag */
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1633  static int ext4_fc_replay_add_range(struct super_block *sb,
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1634  				struct ext4_fc_tl *tl)
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1635  {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1636  	struct ext4_fc_add_range *fc_add_ex;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1637  	struct ext4_extent newex, *ex;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1638  	struct inode *inode;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1639  	ext4_lblk_t start, cur;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1640  	int remaining, len;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1641  	ext4_fsblk_t start_pblk;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1642  	struct ext4_map_blocks map;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1643  	struct ext4_ext_path *path = NULL;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1644  	int ret;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1645  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1646  	fc_add_ex = (struct ext4_fc_add_range *)ext4_fc_tag_val(tl);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1647  	ex = (struct ext4_extent *)&fc_add_ex->fc_ex;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1648  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1649  	trace_ext4_fc_replay(sb, EXT4_FC_TAG_ADD_RANGE,
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1650  		le32_to_cpu(fc_add_ex->fc_ino), le32_to_cpu(ex->ee_block),
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1651  		ext4_ext_get_actual_len(ex));
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1652  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1653  	inode = ext4_iget(sb, le32_to_cpu(fc_add_ex->fc_ino),
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1654  				EXT4_IGET_NORMAL);
23dd561ad9eae0 Yi Li              2020-12-30  1655  	if (IS_ERR(inode)) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1656  		jbd_debug(1, "Inode not found.");
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1657  		return 0;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1658  	}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1659  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1660  	ret = ext4_fc_record_modified_inode(sb, inode->i_ino);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1661  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1662  	start = le32_to_cpu(ex->ee_block);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1663  	start_pblk = ext4_ext_pblock(ex);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1664  	len = ext4_ext_get_actual_len(ex);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1665  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1666  	cur = start;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1667  	remaining = len;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1668  	jbd_debug(1, "ADD_RANGE, lblk %d, pblk %lld, len %d, unwritten %d, inode %ld\n",
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1669  		  start, start_pblk, len, ext4_ext_is_unwritten(ex),
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1670  		  inode->i_ino);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1671  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1672  	while (remaining > 0) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1673  		map.m_lblk = cur;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1674  		map.m_len = remaining;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1675  		map.m_pblk = 0;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1676  		ret = ext4_map_blocks(NULL, inode, &map, 0);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1677  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1678  		if (ret < 0) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1679  			iput(inode);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1680  			return 0;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1681  		}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1682  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1683  		if (ret == 0) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1684  			/* Range is not mapped */
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1685  			path = ext4_find_extent(inode, cur, NULL, 0);
8c9be1e58a8dc0 Harshad Shirwadkar 2020-10-27  1686  			if (IS_ERR(path)) {
8c9be1e58a8dc0 Harshad Shirwadkar 2020-10-27  1687  				iput(inode);
8c9be1e58a8dc0 Harshad Shirwadkar 2020-10-27  1688  				return 0;
8c9be1e58a8dc0 Harshad Shirwadkar 2020-10-27  1689  			}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1690  			memset(&newex, 0, sizeof(newex));
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1691  			newex.ee_block = cpu_to_le32(cur);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1692  			ext4_ext_store_pblock(
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1693  				&newex, start_pblk + cur - start);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1694  			newex.ee_len = cpu_to_le16(map.m_len);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1695  			if (ext4_ext_is_unwritten(ex))
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1696  				ext4_ext_mark_unwritten(&newex);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1697  			down_write(&EXT4_I(inode)->i_data_sem);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1698  			ret = ext4_ext_insert_extent(
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1699  				NULL, inode, &path, &newex, 0);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1700  			up_write((&EXT4_I(inode)->i_data_sem));
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1701  			ext4_ext_drop_refs(path);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1702  			kfree(path);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1703  			if (ret) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1704  				iput(inode);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1705  				return 0;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1706  			}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1707  			goto next;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1708  		}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1709  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1710  		if (start_pblk + cur - start != map.m_pblk) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1711  			/*
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1712  			 * Logical to physical mapping changed. This can happen
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1713  			 * if this range was removed and then reallocated to
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1714  			 * map to new physical blocks during a fast commit.
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1715  			 */
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1716  			ret = ext4_ext_replay_update_ex(inode, cur, map.m_len,
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1717  					ext4_ext_is_unwritten(ex),
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1718  					start_pblk + cur - start);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1719  			if (ret) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1720  				iput(inode);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1721  				return 0;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1722  			}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1723  			/*
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1724  			 * Mark the old blocks as free since they aren't used
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1725  			 * anymore. We maintain an array of all the modified
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1726  			 * inodes. In case these blocks are still used at either
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1727  			 * a different logical range in the same inode or in
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1728  			 * some different inode, we will mark them as allocated
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1729  			 * at the end of the FC replay using our array of
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1730  			 * modified inodes.
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1731  			 */
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1732  			ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1733  			goto next;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1734  		}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1735  
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1736  		/* Range is mapped and needs a state change */
8016e29f4362e2 Harshad Shirwadkar 2020-10-15 @1737  		jbd_debug(1, "Converting from %d to %d %lld",
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1738  				map.m_flags & EXT4_MAP_UNWRITTEN,
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1739  			ext4_ext_is_unwritten(ex), map.m_pblk);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1740  		ret = ext4_ext_replay_update_ex(inode, cur, map.m_len,
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1741  					ext4_ext_is_unwritten(ex), map.m_pblk);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1742  		if (ret) {
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1743  			iput(inode);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1744  			return 0;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1745  		}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1746  		/*
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1747  		 * We may have split the extent tree while toggling the state.
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1748  		 * Try to shrink the extent tree now.
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1749  		 */
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1750  		ext4_ext_replay_shrink_inode(inode, start + len);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1751  next:
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1752  		cur += map.m_len;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1753  		remaining -= map.m_len;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1754  	}
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1755  	ext4_ext_replay_shrink_inode(inode, i_size_read(inode) >>
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1756  					sb->s_blocksize_bits);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1757  	iput(inode);
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1758  	return 0;
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1759  }
8016e29f4362e2 Harshad Shirwadkar 2020-10-15  1760  

:::::: The code at line 1737 was first introduced by commit
:::::: 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2 ext4: fast commit recovery path

:::::: TO: Harshad Shirwadkar <harshadshirwadkar@...il.com>
:::::: CC: Theodore Ts'o <tytso@....edu>

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

Download attachment ".config.gz" of type "application/gzip" (17014 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ