From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: fs/ext4/fast_commit.c:1774:50: sparse: sparse: incorrect type in argument 2 (different base types)
Date: Tue, 25 Jan 2022 00:23:55 +0800 [thread overview]
Message-ID: <202201250031.GhpANyOP-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4203 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 0b5b5a62b945a141e64011b2f90ee7e46f14be98 ext4: use ext4_ext_remove_space() for fast commit replay delete range
date: 2 weeks ago
config: csky-randconfig-s032-20220120 (https://download.01.org/0day-ci/archive/20220125/202201250031.GhpANyOP-lkp(a)intel.com/config)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0b5b5a62b945a141e64011b2f90ee7e46f14be98
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0b5b5a62b945a141e64011b2f90ee7e46f14be98
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> fs/ext4/fast_commit.c:1774:50: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned int [usertype] start @@ got restricted __le32 [addressable] [usertype] fc_lblk @@
fs/ext4/fast_commit.c:1774:50: sparse: expected unsigned int [usertype] start
fs/ext4/fast_commit.c:1774:50: sparse: got restricted __le32 [addressable] [usertype] fc_lblk
>> fs/ext4/fast_commit.c:1775:39: sparse: sparse: restricted __le32 degrades to integer
fs/ext4/fast_commit.c:1775:56: sparse: sparse: restricted __le32 degrades to integer
vim +1774 fs/ext4/fast_commit.c
1724
1725 /* Replay DEL_RANGE tag */
1726 static int
1727 ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
1728 u8 *val)
1729 {
1730 struct inode *inode;
1731 struct ext4_fc_del_range lrange;
1732 struct ext4_map_blocks map;
1733 ext4_lblk_t cur, remaining;
1734 int ret;
1735
1736 memcpy(&lrange, val, sizeof(lrange));
1737 cur = le32_to_cpu(lrange.fc_lblk);
1738 remaining = le32_to_cpu(lrange.fc_len);
1739
1740 trace_ext4_fc_replay(sb, EXT4_FC_TAG_DEL_RANGE,
1741 le32_to_cpu(lrange.fc_ino), cur, remaining);
1742
1743 inode = ext4_iget(sb, le32_to_cpu(lrange.fc_ino), EXT4_IGET_NORMAL);
1744 if (IS_ERR(inode)) {
1745 jbd_debug(1, "Inode %d not found", le32_to_cpu(lrange.fc_ino));
1746 return 0;
1747 }
1748
1749 ret = ext4_fc_record_modified_inode(sb, inode->i_ino);
1750
1751 jbd_debug(1, "DEL_RANGE, inode %ld, lblk %d, len %d\n",
1752 inode->i_ino, le32_to_cpu(lrange.fc_lblk),
1753 le32_to_cpu(lrange.fc_len));
1754 while (remaining > 0) {
1755 map.m_lblk = cur;
1756 map.m_len = remaining;
1757
1758 ret = ext4_map_blocks(NULL, inode, &map, 0);
1759 if (ret < 0) {
1760 iput(inode);
1761 return 0;
1762 }
1763 if (ret > 0) {
1764 remaining -= ret;
1765 cur += ret;
1766 ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
1767 } else {
1768 remaining -= map.m_len;
1769 cur += map.m_len;
1770 }
1771 }
1772
1773 down_write(&EXT4_I(inode)->i_data_sem);
> 1774 ret = ext4_ext_remove_space(inode, lrange.fc_lblk,
> 1775 lrange.fc_lblk + lrange.fc_len - 1);
1776 up_write(&EXT4_I(inode)->i_data_sem);
1777 if (ret) {
1778 iput(inode);
1779 return 0;
1780 }
1781 ext4_ext_replay_shrink_inode(inode,
1782 i_size_read(inode) >> sb->s_blocksize_bits);
1783 ext4_mark_inode_dirty(NULL, inode);
1784 iput(inode);
1785
1786 return 0;
1787 }
1788
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Xin Yin <yinxin.x@bytedance.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Theodore Ts'o <tytso@mit.edu>,
Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: fs/ext4/fast_commit.c:1774:50: sparse: sparse: incorrect type in argument 2 (different base types)
Date: Tue, 25 Jan 2022 00:23:55 +0800 [thread overview]
Message-ID: <202201250031.GhpANyOP-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0
commit: 0b5b5a62b945a141e64011b2f90ee7e46f14be98 ext4: use ext4_ext_remove_space() for fast commit replay delete range
date: 2 weeks ago
config: csky-randconfig-s032-20220120 (https://download.01.org/0day-ci/archive/20220125/202201250031.GhpANyOP-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0b5b5a62b945a141e64011b2f90ee7e46f14be98
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0b5b5a62b945a141e64011b2f90ee7e46f14be98
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> fs/ext4/fast_commit.c:1774:50: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned int [usertype] start @@ got restricted __le32 [addressable] [usertype] fc_lblk @@
fs/ext4/fast_commit.c:1774:50: sparse: expected unsigned int [usertype] start
fs/ext4/fast_commit.c:1774:50: sparse: got restricted __le32 [addressable] [usertype] fc_lblk
>> fs/ext4/fast_commit.c:1775:39: sparse: sparse: restricted __le32 degrades to integer
fs/ext4/fast_commit.c:1775:56: sparse: sparse: restricted __le32 degrades to integer
vim +1774 fs/ext4/fast_commit.c
1724
1725 /* Replay DEL_RANGE tag */
1726 static int
1727 ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
1728 u8 *val)
1729 {
1730 struct inode *inode;
1731 struct ext4_fc_del_range lrange;
1732 struct ext4_map_blocks map;
1733 ext4_lblk_t cur, remaining;
1734 int ret;
1735
1736 memcpy(&lrange, val, sizeof(lrange));
1737 cur = le32_to_cpu(lrange.fc_lblk);
1738 remaining = le32_to_cpu(lrange.fc_len);
1739
1740 trace_ext4_fc_replay(sb, EXT4_FC_TAG_DEL_RANGE,
1741 le32_to_cpu(lrange.fc_ino), cur, remaining);
1742
1743 inode = ext4_iget(sb, le32_to_cpu(lrange.fc_ino), EXT4_IGET_NORMAL);
1744 if (IS_ERR(inode)) {
1745 jbd_debug(1, "Inode %d not found", le32_to_cpu(lrange.fc_ino));
1746 return 0;
1747 }
1748
1749 ret = ext4_fc_record_modified_inode(sb, inode->i_ino);
1750
1751 jbd_debug(1, "DEL_RANGE, inode %ld, lblk %d, len %d\n",
1752 inode->i_ino, le32_to_cpu(lrange.fc_lblk),
1753 le32_to_cpu(lrange.fc_len));
1754 while (remaining > 0) {
1755 map.m_lblk = cur;
1756 map.m_len = remaining;
1757
1758 ret = ext4_map_blocks(NULL, inode, &map, 0);
1759 if (ret < 0) {
1760 iput(inode);
1761 return 0;
1762 }
1763 if (ret > 0) {
1764 remaining -= ret;
1765 cur += ret;
1766 ext4_mb_mark_bb(inode->i_sb, map.m_pblk, map.m_len, 0);
1767 } else {
1768 remaining -= map.m_len;
1769 cur += map.m_len;
1770 }
1771 }
1772
1773 down_write(&EXT4_I(inode)->i_data_sem);
> 1774 ret = ext4_ext_remove_space(inode, lrange.fc_lblk,
> 1775 lrange.fc_lblk + lrange.fc_len - 1);
1776 up_write(&EXT4_I(inode)->i_data_sem);
1777 if (ret) {
1778 iput(inode);
1779 return 0;
1780 }
1781 ext4_ext_replay_shrink_inode(inode,
1782 i_size_read(inode) >> sb->s_blocksize_bits);
1783 ext4_mark_inode_dirty(NULL, inode);
1784 iput(inode);
1785
1786 return 0;
1787 }
1788
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2022-01-24 16:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 16:23 kernel test robot [this message]
2022-01-24 16:23 ` fs/ext4/fast_commit.c:1774:50: sparse: sparse: incorrect type in argument 2 (different base types) kernel test robot
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=202201250031.GhpANyOP-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.