linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [dgc-xfs:xfs-async-inode-reclaim 2/30] fs/xfs/xfs_trans.c:620:30: warning: comparison is always true due to limited range of data type
@ 2020-05-22 15:50 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-22 15:50 UTC (permalink / raw)
  To: Dave Chinner; +Cc: kbuild-all, linux-xfs

[-- Attachment #1: Type: text/plain, Size: 7767 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-async-inode-reclaim
head:   a6b06a056446a604d909fd24f24c78f08f5be671
commit: 624f30f880223745ed1ce2de69f15b53e9ac1ea5 [2/30] xfs: gut error handling in xfs_trans_unreserve_and_mod_sb()
config: x86_64-randconfig-a012-20200522 (attached as .config)
compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
reproduce (this is a W=1 build):
        git checkout 624f30f880223745ed1ce2de69f15b53e9ac1ea5
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/string.h:6:0,
from include/linux/uuid.h:12,
from fs/xfs/xfs_linux.h:10,
from fs/xfs/xfs.h:22,
from fs/xfs/xfs_trans.c:7:
fs/xfs/xfs_trans.c: In function 'xfs_trans_unreserve_and_mod_sb':
fs/xfs/xfs_trans.c:617:31: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
ASSERT(mp->m_sb.sb_frextents >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:617:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_frextents >= 0);
^
fs/xfs/xfs_trans.c:618:29: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
ASSERT(mp->m_sb.sb_dblocks >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:618:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_dblocks >= 0);
^
fs/xfs/xfs_trans.c:619:29: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
ASSERT(mp->m_sb.sb_agcount >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:619:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_agcount >= 0);
^
>> fs/xfs/xfs_trans.c:620:30: warning: comparison is always true due to limited range of data type [-Wtype-limits]
ASSERT(mp->m_sb.sb_imax_pct >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:620:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_imax_pct >= 0);
^
fs/xfs/xfs_trans.c:621:30: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
ASSERT(mp->m_sb.sb_rextsize >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:621:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_rextsize >= 0);
^
fs/xfs/xfs_trans.c:622:31: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
ASSERT(mp->m_sb.sb_rbmblocks >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:622:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_rbmblocks >= 0);
^
fs/xfs/xfs_trans.c:623:29: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
ASSERT(mp->m_sb.sb_rblocks >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:623:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_rblocks >= 0);
^
fs/xfs/xfs_trans.c:624:30: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
ASSERT(mp->m_sb.sb_rextents >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:624:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_rextents >= 0);
^
fs/xfs/xfs_trans.c:625:30: warning: comparison is always true due to limited range of data type [-Wtype-limits]
ASSERT(mp->m_sb.sb_rextslog >= 0);
^
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
# define likely(x) __builtin_expect(!!(x), 1)
^
fs/xfs/xfs_trans.c:625:2: note: in expansion of macro 'ASSERT'
ASSERT(mp->m_sb.sb_rextslog >= 0);
^

vim +620 fs/xfs/xfs_trans.c

   536	
   537	/*
   538	 * xfs_trans_unreserve_and_mod_sb() is called to release unused reservations and
   539	 * apply superblock counter changes to the in-core superblock.  The
   540	 * t_res_fdblocks_delta and t_res_frextents_delta fields are explicitly NOT
   541	 * applied to the in-core superblock.  The idea is that that has already been
   542	 * done.
   543	 *
   544	 * If we are not logging superblock counters, then the inode allocated/free and
   545	 * used block counts are not updated in the on disk superblock. In this case,
   546	 * XFS_TRANS_SB_DIRTY will not be set when the transaction is updated but we
   547	 * still need to update the incore superblock with the changes.
   548	 */
   549	void
   550	xfs_trans_unreserve_and_mod_sb(
   551		struct xfs_trans	*tp)
   552	{
   553		struct xfs_mount	*mp = tp->t_mountp;
   554		bool			rsvd = (tp->t_flags & XFS_TRANS_RESERVE) != 0;
   555		int64_t			blkdelta = 0;
   556		int64_t			rtxdelta = 0;
   557		int64_t			idelta = 0;
   558		int64_t			ifreedelta = 0;
   559		int			error;
   560	
   561		/* calculate deltas */
   562		if (tp->t_blk_res > 0)
   563			blkdelta = tp->t_blk_res;
   564		if ((tp->t_fdblocks_delta != 0) &&
   565		    (xfs_sb_version_haslazysbcount(&mp->m_sb) ||
   566		     (tp->t_flags & XFS_TRANS_SB_DIRTY)))
   567		        blkdelta += tp->t_fdblocks_delta;
   568	
   569		if (tp->t_rtx_res > 0)
   570			rtxdelta = tp->t_rtx_res;
   571		if ((tp->t_frextents_delta != 0) &&
   572		    (tp->t_flags & XFS_TRANS_SB_DIRTY))
   573			rtxdelta += tp->t_frextents_delta;
   574	
   575		if (xfs_sb_version_haslazysbcount(&mp->m_sb) ||
   576		     (tp->t_flags & XFS_TRANS_SB_DIRTY)) {
   577			idelta = tp->t_icount_delta;
   578			ifreedelta = tp->t_ifree_delta;
   579		}
   580	
   581		/* apply the per-cpu counters */
   582		if (blkdelta) {
   583			error = xfs_mod_fdblocks(mp, blkdelta, rsvd);
   584			ASSERT(!error);
   585		}
   586	
   587		if (idelta) {
   588			error = xfs_mod_icount(mp, idelta);
   589			ASSERT(!error);
   590		}
   591	
   592		if (ifreedelta) {
   593			error = xfs_mod_ifree(mp, ifreedelta);
   594			ASSERT(!error);
   595		}
   596	
   597		if (rtxdelta == 0 && !(tp->t_flags & XFS_TRANS_SB_DIRTY))
   598			return;
   599	
   600		/* apply remaining deltas */
   601		spin_lock(&mp->m_sb_lock);
   602		mp->m_sb.sb_frextents += rtxdelta;
   603		mp->m_sb.sb_dblocks += tp->t_dblocks_delta;
   604		mp->m_sb.sb_agcount += tp->t_agcount_delta;
   605		mp->m_sb.sb_imax_pct += tp->t_imaxpct_delta;
   606		mp->m_sb.sb_rextsize += tp->t_rextsize_delta;
   607		mp->m_sb.sb_rbmblocks += tp->t_rbmblocks_delta;
   608		mp->m_sb.sb_rblocks += tp->t_rblocks_delta;
   609		mp->m_sb.sb_rextents += tp->t_rextents_delta;
   610		mp->m_sb.sb_rextslog += tp->t_rextslog_delta;
   611		spin_unlock(&mp->m_sb_lock);
   612	
   613		/*
   614		 * Debug checks outside of the spinlock so they don't lock up the
   615		 * machine if they fail.
   616		 */
   617		ASSERT(mp->m_sb.sb_frextents >= 0);
   618		ASSERT(mp->m_sb.sb_dblocks >= 0);
   619		ASSERT(mp->m_sb.sb_agcount >= 0);
 > 620		ASSERT(mp->m_sb.sb_imax_pct >= 0);
   621		ASSERT(mp->m_sb.sb_rextsize >= 0);
   622		ASSERT(mp->m_sb.sb_rbmblocks >= 0);
   623		ASSERT(mp->m_sb.sb_rblocks >= 0);
   624		ASSERT(mp->m_sb.sb_rextents >= 0);
   625		ASSERT(mp->m_sb.sb_rextslog >= 0);
   626		return;
   627	}
   628	

---
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: 36308 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-22 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 15:50 [dgc-xfs:xfs-async-inode-reclaim 2/30] fs/xfs/xfs_trans.c:620:30: warning: comparison is always true due to limited range of data type kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).