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>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
<linux-kernel@vger.kernel.org>
Subject: [djwong-xfs:vectorized-scrub 196/308] fs/xfs/libxfs/xfs_alloc.c:2564:3: warning: Value stored to 'agno' is never read [clang-analyzer-deadcode.DeadStores]
Date: Tue, 19 Oct 2021 16:01:24 +0800 [thread overview]
Message-ID: <7fe03eff-a6d4-7036-4dee-9ce9a04fd08a@intel.com> (raw)
In-Reply-To: <202110190404.zRJnUe95-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 6299 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git vectorized-scrub
head: d404c6b945070ba14d8db1ee79daa5df149877df
commit: 13631516b02090441a5c788ae69b076009c44418 [196/308] xfs: support logging EFIs for realtime extents
config: arm-randconfig-c002-20211017 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 746dd6a700931988dd9021d3d04718f1929885a5)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/commit/?id=13631516b02090441a5c788ae69b076009c44418
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs vectorized-scrub
git checkout 13631516b02090441a5c788ae69b076009c44418
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 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/libxfs/xfs_alloc.c:2564:3: warning: Value stored to 'agno' is never read [clang-analyzer-deadcode.DeadStores]
agno = 0;
^ ~
>> fs/xfs/libxfs/xfs_alloc.c:2565:3: warning: Value stored to 'agbno' is never read [clang-analyzer-deadcode.DeadStores]
agbno = bno;
^ ~~~
vim +/agno +2564 fs/xfs/libxfs/xfs_alloc.c
f8f2835a9cf300 Brian Foster 2018-05-07 2540
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2541 /*
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2542 * Add the extent to the list of extents to be free at transaction end.
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2543 * The list is maintained sorted (by block number).
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2544 */
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2545 void
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2546 xfs_free_extent_later(
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2547 struct xfs_trans *tp,
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2548 xfs_fsblock_t bno,
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2549 xfs_filblks_t len,
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2550 const struct xfs_owner_info *oinfo,
30bb91bc0f3b93 Darrick J. Wong 2021-09-01 2551 unsigned int flags)
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2552 {
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2553 struct xfs_extent_free_item *new; /* new element */
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2554 #ifdef DEBUG
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2555 struct xfs_mount *mp = tp->t_mountp;
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2556 xfs_agnumber_t agno;
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2557 xfs_agblock_t agbno;
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2558
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2559 ASSERT(bno != NULLFSBLOCK);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2560 ASSERT(len > 0);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2561 ASSERT(len <= MAXEXTLEN);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2562 ASSERT(!isnullstartblock(bno));
13631516b02090 Darrick J. Wong 2021-09-01 2563 if (flags & XFS_FREE_EXTENT_REALTIME) {
13631516b02090 Darrick J. Wong 2021-09-01 @2564 agno = 0;
13631516b02090 Darrick J. Wong 2021-09-01 @2565 agbno = bno;
13631516b02090 Darrick J. Wong 2021-09-01 2566 ASSERT(bno < mp->m_sb.sb_rblocks);
13631516b02090 Darrick J. Wong 2021-09-01 2567 ASSERT(len <= mp->m_sb.sb_rblocks);
13631516b02090 Darrick J. Wong 2021-09-01 2568 ASSERT(bno + len <= mp->m_sb.sb_rblocks);
13631516b02090 Darrick J. Wong 2021-09-01 2569 } else {
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2570 agno = XFS_FSB_TO_AGNO(mp, bno);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2571 agbno = XFS_FSB_TO_AGBNO(mp, bno);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2572 ASSERT(agno < mp->m_sb.sb_agcount);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2573 ASSERT(agbno < mp->m_sb.sb_agblocks);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2574 ASSERT(len < mp->m_sb.sb_agblocks);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2575 ASSERT(agbno + len <= mp->m_sb.sb_agblocks);
13631516b02090 Darrick J. Wong 2021-09-01 2576 }
30bb91bc0f3b93 Darrick J. Wong 2021-09-01 2577 ASSERT(!(flags & ~XFS_FREE_EXTENT_ALL_FLAGS));
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2578 #endif
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2579 ASSERT(xfs_extent_free_item_zone != NULL);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2580
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2581 new = kmem_cache_alloc(xfs_extent_free_item_zone,
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2582 GFP_KERNEL | __GFP_NOFAIL);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2583 new->xefi_startblock = bno;
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2584 new->xefi_blockcount = (xfs_extlen_t)len;
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2585 if (oinfo)
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2586 new->xefi_oinfo = *oinfo;
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2587 else
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2588 new->xefi_oinfo = XFS_RMAP_OINFO_SKIP_UPDATE;
30bb91bc0f3b93 Darrick J. Wong 2021-09-01 2589 new->xefi_skip_discard = !!(flags & XFS_FREE_EXTENT_SKIP_DISCARD);
13631516b02090 Darrick J. Wong 2021-09-01 2590 new->xefi_realtime = !!(flags & XFS_FREE_EXTENT_REALTIME);
5262e94653712f Darrick J. Wong 2021-09-01 2591
5262e94653712f Darrick J. Wong 2021-09-01 2592 trace_xfs_extent_free_defer(tp->t_mountp, XFS_FREE_EXTENT_REGULAR,
5262e94653712f Darrick J. Wong 2021-09-01 2593 new);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2594 xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_FREE, &new->xefi_list);
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2595 }
0c34a6f15b5c3a Darrick J. Wong 2021-09-01 2596
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33030 bytes --]
parent reply other threads:[~2021-10-19 8:02 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <202110190404.zRJnUe95-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=7fe03eff-a6d4-7036-4dee-9ce9a04fd08a@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®