From: kernel test robot <yujie.liu@intel.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: [djwong-xfs:direct-xfile-mapped-buffers 103/333] fs/xfs/xfs_rtalloc.c:1439:17: warning: Value stored to 'off' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
Date: Sat, 27 Nov 2021 21:09:21 +0800 [thread overview]
Message-ID: <e6089409-f85c-3a2b-66fe-d1684289eac7@intel.com> (raw)
In-Reply-To: <202111260911.JKJz6fEX-lkp@intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git direct-xfile-mapped-buffers
head: 014cdddffcddd5b13402721de744b9ea76961d74
commit: bd7fa0e8c47bcda25664e1b2572d33a8d61d29c3 [103/333] xfs: make atomic extent swapping support realtime files
config: i386-randconfig-c001-20211031 (https://download.01.org/0day-ci/archive/20211126/202111260911.JKJz6fEX-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d321548c3ce987f4f21350ba1c81fdb5d4354224)
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/djwong/xfs-linux.git/commit/?id=bd7fa0e8c47bcda25664e1b2572d33a8d61d29c3
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs direct-xfile-mapped-buffers
git checkout bd7fa0e8c47bcda25664e1b2572d33a8d61d29c3
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_rtalloc.c:1439:17: warning: Value stored to 'off' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
xfs_fileoff_t off = XFS_B_TO_FSBT(mp, pos);
^~~
vim +/off +1439 fs/xfs/xfs_rtalloc.c
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1422
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1423 /*
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1424 * For all realtime extents backing the given range of a file, search for
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1425 * unwritten mappings that are do not cover a full rt extent and convert them
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1426 * to zeroed written mappings. The goal is to end up with one mapping per rt
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1427 * extent so that we can perform a remapping operation. Callers must ensure
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1428 * that there are no dirty pages in the given range.
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1429 */
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1430 int
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1431 xfs_rtfile_convert_unwritten(
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1432 struct xfs_inode *ip,
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1433 loff_t pos,
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1434 uint64_t len)
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1435 {
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1436 struct xfs_bmbt_irec irec;
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1437 struct xfs_trans *tp;
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1438 struct xfs_mount *mp = ip->i_mount;
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 @1439 xfs_fileoff_t off = XFS_B_TO_FSBT(mp, pos);
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1440 xfs_fileoff_t endoff;
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1441 unsigned int resblks;
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1442 int ret;
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1443
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1444 if (mp->m_sb.sb_rextsize == 1)
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1445 return 0;
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1446
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 @1447 off = rounddown_64(XFS_B_TO_FSBT(mp, pos), mp->m_sb.sb_rextsize);
bd7fa0e8c47bcda Darrick J. Wong 2021-09-01 1448 endoff = roundup_64(XFS_B_TO_FSB(mp, pos + len), mp->m_sb.sb_rextsize);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
parent reply other threads:[~2021-11-27 13:11 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <202111260911.JKJz6fEX-lkp@intel.com>]
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=e6089409-f85c-3a2b-66fe-d1684289eac7@intel.com \
--to=yujie.liu@intel.com \
--cc=darrick.wong@oracle.com \
--cc=djwong@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
/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
all inboxes | Powered by JetHome®