All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: allison.henderson@oracle.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH v3 24/26] xfs: Add parent pointer ioctl
Date: Thu, 22 Sep 2022 22:02:59 +0800	[thread overview]
Message-ID: <202209222130.jwQOkbWn-lkp@intel.com> (raw)
In-Reply-To: <20220922054458.40826-25-allison.henderson@oracle.com>

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on xfs-linux/for-next]
[also build test WARNING on next-20220921]
[cannot apply to linus/master v6.0-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/allison-henderson-oracle-com/Parent-Pointers/20220922-134750
base:   https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
config: s390-randconfig-r044-20220922 (https://download.01.org/0day-ci/archive/20220922/202209222130.jwQOkbWn-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
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 s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://github.com/intel-lab-lkp/linux/commit/68cfc39e9d3f8a2a85b516d7c9c8491a2333820f
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review allison-henderson-oracle-com/Parent-Pointers/20220922-134750
        git checkout 68cfc39e9d3f8a2a85b516d7c9c8491a2333820f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash fs/xfs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> fs/xfs/xfs_parent_utils.c:31:1: warning: no previous prototype for function 'xfs_attr_get_parent_pointer' [-Wmissing-prototypes]
   xfs_attr_get_parent_pointer(
   ^
   fs/xfs/xfs_parent_utils.c:30:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int
   ^
   static 
>> fs/xfs/xfs_parent_utils.c:57:6: warning: variable 'lock_mode' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (error)
               ^~~~~
   fs/xfs/xfs_parent_utils.c:121:18: note: uninitialized use occurs here
           xfs_iunlock(ip, lock_mode);
                           ^~~~~~~~~
   fs/xfs/xfs_parent_utils.c:57:2: note: remove the 'if' if its condition is always false
           if (error)
           ^~~~~~~~~~
   fs/xfs/xfs_parent_utils.c:44:26: note: initialize the variable 'lock_mode' to silence this warning
           unsigned int                    lock_mode, flags = XFS_ATTR_PARENT;
                                                    ^
                                                     = 0
   2 warnings generated.


vim +/xfs_attr_get_parent_pointer +31 fs/xfs/xfs_parent_utils.c

    24	
    25	/*
    26	 * Get the parent pointers for a given inode
    27	 *
    28	 * Returns 0 on success and non zero on error
    29	 */
    30	int
  > 31	xfs_attr_get_parent_pointer(
    32		struct xfs_inode		*ip,
    33		struct xfs_pptr_info		*ppi)
    34	{
    35	
    36		struct xfs_attrlist		*alist;
    37		struct xfs_attrlist_ent		*aent;
    38		struct xfs_parent_ptr		*xpp;
    39		struct xfs_parent_name_rec	*xpnr;
    40		char				*namebuf;
    41		unsigned int			namebuf_size;
    42		int				name_len, i, error = 0;
    43		unsigned int			ioc_flags = XFS_IOC_ATTR_PARENT;
    44		unsigned int			lock_mode, flags = XFS_ATTR_PARENT;
    45		struct xfs_attr_list_context	context;
    46	
    47		/* Allocate a buffer to store the attribute names */
    48		namebuf_size = sizeof(struct xfs_attrlist) +
    49			       (ppi->pi_ptrs_size) * sizeof(struct xfs_attrlist_ent);
    50		namebuf = kvzalloc(namebuf_size, GFP_KERNEL);
    51		if (!namebuf)
    52			return -ENOMEM;
    53	
    54		memset(&context, 0, sizeof(struct xfs_attr_list_context));
    55		error = xfs_ioc_attr_list_context_init(ip, namebuf, namebuf_size,
    56				ioc_flags, &context);
  > 57		if (error)
    58			goto out_kfree;
    59	
    60		/* Copy the cursor provided by caller */
    61		memcpy(&context.cursor, &ppi->pi_cursor,
    62			sizeof(struct xfs_attrlist_cursor));
    63		context.attr_filter = XFS_ATTR_PARENT;
    64	
    65		lock_mode = xfs_ilock_attr_map_shared(ip);
    66	
    67		error = xfs_attr_list_ilocked(&context);
    68		if (error)
    69			goto out_kfree;
    70	
    71		alist = (struct xfs_attrlist *)namebuf;
    72		for (i = 0; i < alist->al_count; i++) {
    73			struct xfs_da_args args = {
    74				.geo = ip->i_mount->m_attr_geo,
    75				.whichfork = XFS_ATTR_FORK,
    76				.dp = ip,
    77				.namelen = sizeof(struct xfs_parent_name_rec),
    78				.attr_filter = flags,
    79				.op_flags = XFS_DA_OP_OKNOENT,
    80			};
    81	
    82			xpp = xfs_ppinfo_to_pp(ppi, i);
    83			memset(xpp, 0, sizeof(struct xfs_parent_ptr));
    84			aent = (struct xfs_attrlist_ent *)
    85				&namebuf[alist->al_offset[i]];
    86			xpnr = (struct xfs_parent_name_rec *)(aent->a_name);
    87	
    88			if (aent->a_valuelen > XFS_PPTR_MAXNAMELEN) {
    89				error = -EFSCORRUPTED;
    90				goto out_kfree;
    91			}
    92			name_len = aent->a_valuelen;
    93	
    94			args.name = (char *)xpnr;
    95			args.hashval = xfs_da_hashname(args.name, args.namelen),
    96			args.value = (unsigned char *)(xpp->xpp_name);
    97			args.valuelen = name_len;
    98	
    99			error = xfs_attr_get_ilocked(&args);
   100			error = (error == -EEXIST ? 0 : error);
   101			if (error) {
   102				error = -EFSCORRUPTED;
   103				goto out_kfree;
   104			}
   105	
   106			xfs_init_parent_ptr(xpp, xpnr);
   107			if(!xfs_verify_ino(args.dp->i_mount, xpp->xpp_ino)) {
   108				error = -EFSCORRUPTED;
   109				goto out_kfree;
   110			}
   111		}
   112		ppi->pi_ptrs_used = alist->al_count;
   113		if (!alist->al_more)
   114			ppi->pi_flags |= XFS_PPTR_OFLAG_DONE;
   115	
   116		/* Update the caller with the current cursor position */
   117		memcpy(&ppi->pi_cursor, &context.cursor,
   118			sizeof(struct xfs_attrlist_cursor));
   119	
   120	out_kfree:
   121		xfs_iunlock(ip, lock_mode);
   122		kvfree(namebuf);
   123	
   124		return error;
   125	}
   126	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

  reply	other threads:[~2022-09-22 14:03 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  5:44 [PATCH v3 00/26] Parent Pointers allison.henderson
2022-09-22  5:44 ` [PATCH v3 01/26] xfs: Add new name to attri/d allison.henderson
2022-09-23 18:53   ` Darrick J. Wong
2022-09-23 20:43     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 02/26] xfs: Increase XFS_DEFER_OPS_NR_INODES to 5 allison.henderson
2022-09-23 19:02   ` Darrick J. Wong
2022-09-23 20:45     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 03/26] xfs: Hold inode locks in xfs_ialloc allison.henderson
2022-09-22  5:44 ` [PATCH v3 04/26] xfs: Hold inode locks in xfs_trans_alloc_dir allison.henderson
2022-09-23 19:04   ` Darrick J. Wong
2022-09-23 20:44     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 05/26] xfs: Hold inode locks in xfs_rename allison.henderson
2022-09-23 19:21   ` Darrick J. Wong
2022-09-23 20:44     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 06/26] xfs: Expose init_xattrs in xfs_create_tmpfile allison.henderson
2022-09-23 19:25   ` Darrick J. Wong
2022-09-23 20:45     ` Allison Henderson
2022-09-23 21:18       ` Darrick J. Wong
2022-09-22  5:44 ` [PATCH v3 07/26] xfs: get directory offset when adding directory name allison.henderson
2022-09-22  5:44 ` [PATCH v3 08/26] xfs: get directory offset when removing " allison.henderson
2022-09-22  5:44 ` [PATCH v3 09/26] xfs: get directory offset when replacing a " allison.henderson
2022-09-22  5:44 ` [PATCH v3 10/26] xfs: add parent pointer support to attribute code allison.henderson
2022-09-22  5:44 ` [PATCH v3 11/26] xfs: define parent pointer xattr format allison.henderson
2022-09-22  5:44 ` [PATCH v3 12/26] xfs: Add xfs_verify_pptr allison.henderson
2022-09-22  5:44 ` [PATCH v3 13/26] xfs: extend transaction reservations for parent attributes allison.henderson
2022-09-23 20:17   ` Darrick J. Wong
2022-09-23 23:53     ` Allison Henderson
2022-09-26 23:53       ` Darrick J. Wong
2022-09-27 20:04         ` Allison Henderson
2022-09-27 20:44           ` Darrick J. Wong
2022-09-22  5:44 ` [PATCH v3 14/26] xfs: parent pointer attribute creation allison.henderson
2022-09-23 21:11   ` Darrick J. Wong
2022-09-26 21:48     ` Allison Henderson
2022-09-26 23:54       ` Darrick J. Wong
2022-09-27 20:10         ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 15/26] xfs: add parent attributes to link allison.henderson
2022-09-23 20:31   ` Darrick J. Wong
2022-09-26 21:49     ` Allison Henderson
2022-09-26 23:55       ` Darrick J. Wong
2022-09-22  5:44 ` [PATCH v3 16/26] xfs: add parent attributes to symlink allison.henderson
2022-09-23 21:16   ` Darrick J. Wong
2022-09-26 21:48     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 17/26] xfs: remove parent pointers in unlink allison.henderson
2022-09-23 21:22   ` Darrick J. Wong
2022-09-26 21:49     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 18/26] xfs: Add parent pointers to xfs_cross_rename allison.henderson
2022-09-23 21:52   ` Darrick J. Wong
2022-09-26 21:50     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 19/26] xfs: Indent xfs_rename allison.henderson
2022-09-23 21:22   ` Darrick J. Wong
2022-09-26 21:49     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 20/26] xfs: Add parent pointers to rename allison.henderson
2022-09-23 22:08   ` Darrick J. Wong
2022-09-26 21:50     ` Allison Henderson
2022-09-22  5:44 ` [PATCH v3 21/26] xfs: Add the parent pointer support to the superblock version 5 allison.henderson
2022-09-22  5:44 ` [PATCH v3 22/26] xfs: Add helper function xfs_attr_list_context_init allison.henderson
2022-09-22  5:44 ` [PATCH v3 23/26] xfs: Filter XFS_ATTR_PARENT for getfattr allison.henderson
2022-09-22 16:55   ` Allison Henderson
2022-09-23 21:45   ` Darrick J. Wong
2022-09-26 21:49     ` Allison Henderson
2022-09-27 18:32       ` Darrick J. Wong
2022-09-28 18:22         ` Allison Henderson
2022-09-28  1:13   ` [xfs] b73248c4ee: xfstests.xfs.269.fail kernel test robot
2022-09-28  1:13     ` kernel test robot
2022-09-22  5:44 ` [PATCH v3 24/26] xfs: Add parent pointer ioctl allison.henderson
2022-09-22 14:02   ` kernel test robot [this message]
2022-09-24  0:30   ` Darrick J. Wong
2022-09-26 21:50     ` Allison Henderson
2022-09-27 18:34       ` Darrick J. Wong
2022-09-22  5:44 ` [PATCH v3 25/26] xfs: fix unit conversion error in xfs_log_calc_max_attrsetm_res allison.henderson
2022-09-23 21:47   ` Darrick J. Wong
2022-09-26 21:50     ` Allison Henderson
2022-09-27  0:02       ` Darrick J. Wong
2022-09-22  5:44 ` [PATCH v3 26/26] xfs: drop compatibility minimum log size computations for reflink allison.henderson
2022-09-23 21:48   ` Darrick J. Wong
2022-09-26 21:50     ` Allison Henderson

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=202209222130.jwQOkbWn-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=allison.henderson@oracle.com \
    --cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.