2021-07-26 02:35:35

by kernel test robot

[permalink] [raw]
Subject: [allisonhenderson-xfs_work:delayed_attrs_v22_extended 9/32] fs/xfs/xfs_attr_item.c:638:5: warning: variable 'rsvd' is uninitialized when used here

tree: https://github.com/allisonhenderson/xfs_work.git delayed_attrs_v22_extended
head: 43a95c4600b7c80ac410a00ac245ccf85b150d26
commit: a081aa472665a7b050bb4b34949559a187507c24 [9/32] xfs: Implement attr logging and replay
config: x86_64-randconfig-a003-20210725 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project c63dbd850182797bc4b76124d08e1c320ab2365d)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/allisonhenderson/xfs_work/commit/a081aa472665a7b050bb4b34949559a187507c24
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 a081aa472665a7b050bb4b34949559a187507c24
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> fs/xfs/xfs_attr_item.c:638:5: warning: variable 'rsvd' is uninitialized when used here [-Wuninitialized]
rsvd ? XFS_TRANS_RESERVE : 0, &tp);
^~~~
fs/xfs/xfs_attr_item.c:586:14: note: initialize the variable 'rsvd' to silence this warning
bool rsvd;
^
= 0
1 warning generated.


vim +/rsvd +638 fs/xfs/xfs_attr_item.c

569
570 /*
571 * Process an attr intent item that was recovered from the log. We need to
572 * delete the attr that it describes.
573 */
574 STATIC int
575 xfs_attri_item_recover(
576 struct xfs_log_item *lip,
577 struct list_head *capture_list)
578 {
579 struct xfs_attri_log_item *attrip = ATTRI_ITEM(lip);
580 struct xfs_attr_item *attr;
581 struct xfs_mount *mp = lip->li_mountp;
582 struct xfs_inode *ip;
583 struct xfs_da_args *args;
584 struct xfs_trans *tp;
585 struct xfs_trans_res tres;
586 bool rsvd;
587 struct xfs_attri_log_format *attrp;
588 int error, ret = 0;
589 int total;
590 int local;
591 struct xfs_attrd_log_item *done_item = NULL;
592
593 /*
594 * First check the validity of the attr described by the ATTRI. If any
595 * are bad, then assume that all are bad and just toss the ATTRI.
596 */
597 attrp = &attrip->attri_format;
598 if (!xfs_attri_validate(mp, attrip))
599 return -EFSCORRUPTED;
600
601 error = xlog_recover_iget(mp, attrp->alfi_ino, &ip);
602 if (error)
603 return error;
604
605 attr = kmem_zalloc(sizeof(struct xfs_attr_item) +
606 sizeof(struct xfs_da_args), KM_NOFS);
607 args = (struct xfs_da_args *)((char *)attr +
608 sizeof(struct xfs_attr_item));
609
610 attr->xattri_dac.da_args = args;
611 attr->xattri_op_flags = attrp->alfi_op_flags;
612
613 args->dp = ip;
614 args->geo = mp->m_attr_geo;
615 args->op_flags = attrp->alfi_op_flags;
616 args->whichfork = XFS_ATTR_FORK;
617 args->name = attrip->attri_name;
618 args->namelen = attrp->alfi_name_len;
619 args->hashval = xfs_da_hashname(args->name, args->namelen);
620 args->attr_filter = attrp->alfi_attr_flags;
621
622 if (attrp->alfi_op_flags == XFS_ATTR_OP_FLAGS_SET) {
623 args->value = attrip->attri_value;
624 args->valuelen = attrp->alfi_value_len;
625 args->total = xfs_attr_calc_size(args, &local);
626
627 tres.tr_logres = M_RES(mp)->tr_attrsetm.tr_logres +
628 M_RES(mp)->tr_attrsetrt.tr_logres *
629 args->total;
630 tres.tr_logcount = XFS_ATTRSET_LOG_COUNT;
631 tres.tr_logflags = XFS_TRANS_PERM_LOG_RES;
632 total = args->total;
633 } else {
634 tres = M_RES(mp)->tr_attrrm;
635 total = XFS_ATTRRM_SPACE_RES(mp);
636 }
637 error = xfs_trans_alloc(mp, &tres, total, 0,
> 638 rsvd ? XFS_TRANS_RESERVE : 0, &tp);
639 if (error)
640 goto out;
641
642 args->trans = tp;
643 done_item = xfs_trans_get_attrd(tp, attrip);
644
645 xfs_ilock(ip, XFS_ILOCK_EXCL);
646 xfs_trans_ijoin(tp, ip, 0);
647
648 ret = xfs_trans_attr_finish_update(&attr->xattri_dac, done_item,
649 &attr->xattri_dac.leaf_bp,
650 attrp->alfi_op_flags);
651 if (ret == -EAGAIN) {
652 /* There's more work to do, so add it to this transaction */
653 xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_ATTR, &attr->xattri_list);
654 } else
655 error = ret;
656
657 if (error) {
658 xfs_trans_cancel(tp);
659 goto out_unlock;
660 }
661
662 error = xfs_defer_ops_capture_and_commit(tp, ip, capture_list);
663
664 out_unlock:
665 xfs_iunlock(ip, XFS_ILOCK_EXCL);
666 xfs_irele(ip);
667 out:
668 if (ret != -EAGAIN)
669 kmem_free(attr);
670 return error;
671 }
672

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (5.48 kB)
.config.gz (34.97 kB)
Download all attachments