[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202107261628.NkA4LL2E-lkp@intel.com>
Date: Mon, 26 Jul 2021 16:39:35 +0800
From: kernel test robot <lkp@...el.com>
To: Allison Henderson <allison.henderson@...cle.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Mark Tinguely <tinguely@....com>,
Dave Chinner <dchinner@...hat.com>
Subject: [allisonhenderson-xfs_work:delayed_attrs_v22_extended 21/32]
fs/xfs/libxfs/xfs_attr.c:659:65: warning: bitwise comparison always
evaluates to true
tree: https://github.com/allisonhenderson/xfs_work.git delayed_attrs_v22_extended
head: 43a95c4600b7c80ac410a00ac245ccf85b150d26
commit: 40588f91b003a40a0e7ee250219f6405c616a529 [21/32] xfs: add parent pointer support to attribute code
config: nds32-buildonly-randconfig-r001-20210726 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 10.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://github.com/allisonhenderson/xfs_work/commit/40588f91b003a40a0e7ee250219f6405c616a529
git remote add allisonhenderson-xfs_work https://github.com/allisonhenderson/xfs_work.git
git fetch --no-tags allisonhenderson-xfs_work delayed_attrs_v22_extended
git checkout 40588f91b003a40a0e7ee250219f6405c616a529
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross ARCH=nds32
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 >>):
fs/xfs/libxfs/xfs_attr.c: In function 'xfs_attr_set':
>> fs/xfs/libxfs/xfs_attr.c:659:65: warning: bitwise comparison always evaluates to true [-Wtautological-compare]
659 | rsvd = ((args->attr_filter & XFS_ATTR_ROOT) | XFS_ATTR_PARENT) != 0;
| ^~
vim +659 fs/xfs/libxfs/xfs_attr.c
642
643 /*
644 * Note: If args->value is NULL the attribute will be removed, just like the
645 * Linux ->setattr API.
646 */
647 int
648 xfs_attr_set(
649 struct xfs_da_args *args)
650 {
651 struct xfs_inode *dp = args->dp;
652 struct xfs_mount *mp = dp->i_mount;
653 struct xfs_trans_res tres;
654 bool rsvd;
655 int error, local;
656 int rmt_blks = 0;
657 unsigned int total;
658
> 659 rsvd = ((args->attr_filter & XFS_ATTR_ROOT) | XFS_ATTR_PARENT) != 0;
660
661 if (XFS_FORCED_SHUTDOWN(dp->i_mount))
662 return -EIO;
663
664 error = xfs_qm_dqattach(dp);
665 if (error)
666 return error;
667
668 args->geo = mp->m_attr_geo;
669 args->whichfork = XFS_ATTR_FORK;
670 args->hashval = xfs_da_hashname(args->name, args->namelen);
671
672 /*
673 * We have no control over the attribute names that userspace passes us
674 * to remove, so we have to allow the name lookup prior to attribute
675 * removal to fail as well.
676 */
677 args->op_flags = XFS_DA_OP_OKNOENT;
678
679 if (args->value) {
680 XFS_STATS_INC(mp, xs_attr_set);
681
682 args->op_flags |= XFS_DA_OP_ADDNAME;
683 args->total = xfs_attr_calc_size(args, &local);
684
685 /*
686 * If the inode doesn't have an attribute fork, add one.
687 * (inode must not be locked when we call this routine)
688 */
689 if (XFS_IFORK_Q(dp) == 0) {
690 int sf_size = sizeof(struct xfs_attr_sf_hdr) +
691 xfs_attr_sf_entsize_byname(args->namelen,
692 args->valuelen);
693
694 error = xfs_bmap_add_attrfork(dp, sf_size, rsvd);
695 if (error)
696 return error;
697 }
698
699 tres.tr_logres = M_RES(mp)->tr_attrsetm.tr_logres +
700 M_RES(mp)->tr_attrsetrt.tr_logres *
701 args->total;
702 tres.tr_logcount = XFS_ATTRSET_LOG_COUNT;
703 tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
704 total = args->total;
705
706 if (!local)
707 rmt_blks = xfs_attr3_rmt_blocks(mp, args->valuelen);
708 } else {
709 XFS_STATS_INC(mp, xs_attr_remove);
710
711 tres = M_RES(mp)->tr_attrrm;
712 total = XFS_ATTRRM_SPACE_RES(mp);
713 rmt_blks = xfs_attr3_rmt_blocks(mp, XFS_XATTR_SIZE_MAX);
714 }
715
716 if (xfs_hasdelattr(mp)) {
717 error = xfs_attr_use_log_assist(mp);
718 if (error)
719 return error;
720 }
721
722 /*
723 * Root fork attributes can use reserved data blocks for this
724 * operation if necessary
725 */
726 error = xfs_trans_alloc_inode(dp, &tres, total, 0, rsvd, &args->trans);
727 if (error)
728 goto drop_incompat;
729
730 if (args->value || xfs_inode_hasattr(dp)) {
731 error = xfs_iext_count_may_overflow(dp, XFS_ATTR_FORK,
732 XFS_IEXT_ATTR_MANIP_CNT(rmt_blks));
733 if (error)
734 goto out_trans_cancel;
735 }
736
737 if (args->value) {
738 error = xfs_has_attr(args);
739 if (error == -EEXIST && (args->attr_flags & XATTR_CREATE))
740 goto out_trans_cancel;
741 if (error == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
742 goto out_trans_cancel;
743 if (error != -ENOATTR && error != -EEXIST)
744 goto out_trans_cancel;
745
746 error = xfs_attr_set_deferred(args);
747 if (error)
748 goto out_trans_cancel;
749
750 /* shortform attribute has already been committed */
751 if (!args->trans)
752 goto out_unlock;
753 } else {
754 error = xfs_has_attr(args);
755 if (error != -EEXIST)
756 goto out_trans_cancel;
757
758 error = xfs_attr_remove_deferred(args);
759 if (error)
760 goto out_trans_cancel;
761 }
762
763 /*
764 * If this is a synchronous mount, make sure that the
765 * transaction goes to disk before returning to the user.
766 */
767 if (mp->m_flags & XFS_MOUNT_WSYNC)
768 xfs_trans_set_sync(args->trans);
769
770 if (!(args->op_flags & XFS_DA_OP_NOTIME))
771 xfs_trans_ichgtime(args->trans, dp, XFS_ICHGTIME_CHG);
772
773 /*
774 * Commit the last in the sequence of transactions.
775 */
776 xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE);
777 error = xfs_trans_commit(args->trans);
778 out_unlock:
779 xfs_iunlock(dp, XFS_ILOCK_EXCL);
780 drop_incompat:
781 if (xfs_hasdelattr(mp))
782 xlog_drop_incompat_feat(mp->m_log);
783 return error;
784
785 out_trans_cancel:
786 if (args->trans)
787 xfs_trans_cancel(args->trans);
788 goto out_unlock;
789 }
790
---
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" (33928 bytes)
Powered by blists - more mailing lists