From: kernel test robot <lkp@intel.com>
To: Ian Kent <raven@themaw.net>, xfs <linux-xfs@vger.kernel.org>,
"Darrick J. Wong" <djwong@kernel.org>
Cc: kbuild-all@lists.01.org, Miklos Szeredi <miklos@szeredi.hu>,
Brian Foster <bfoster@redhat.com>,
Al Viro <viro@ZenIV.linux.org.uk>,
David Howells <dhowells@redhat.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] xfs: make sure link path does not go away at access
Date: Thu, 18 Nov 2021 04:38:42 +0800 [thread overview]
Message-ID: <202111180446.pww2xiQ6-lkp@intel.com> (raw)
In-Reply-To: <163660197073.22525.11235124150551283676.stgit@mickey.themaw.net>
[-- Attachment #1: Type: text/plain, Size: 4892 bytes --]
Hi Ian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on xfs-linux/for-next]
[also build test WARNING on mszeredi-vfs/overlayfs-next linus/master v5.16-rc1 next-20211117]
[cannot apply to djwong-xfs/djwong-devel]
[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]
url: https://github.com/0day-ci/linux/commits/Ian-Kent/vfs-check-dentry-is-still-valid-in-get_link/20211111-114013
base: https://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git for-next
config: i386-randconfig-s001-20211115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/1208c3b6210fbb49718cdf4fa5f7db35bea008f6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ian-Kent/vfs-check-dentry-is-still-valid-in-get_link/20211111-114013
git checkout 1208c3b6210fbb49718cdf4fa5f7db35bea008f6
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash fs/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> fs/xfs/xfs_inode.c:2648:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> fs/xfs/xfs_inode.c:2648:17: sparse: char [noderef] __rcu *
>> fs/xfs/xfs_inode.c:2648:17: sparse: char *
--
>> fs/xfs/xfs_iops.c:531:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> fs/xfs/xfs_iops.c:531:16: sparse: char [noderef] __rcu *
>> fs/xfs/xfs_iops.c:531:16: sparse: char *
vim +2648 fs/xfs/xfs_inode.c
2600
2601 /*
2602 * This is called to return an inode to the inode free list.
2603 * The inode should already be truncated to 0 length and have
2604 * no pages associated with it. This routine also assumes that
2605 * the inode is already a part of the transaction.
2606 *
2607 * The on-disk copy of the inode will have been added to the list
2608 * of unlinked inodes in the AGI. We need to remove the inode from
2609 * that list atomically with respect to freeing it here.
2610 */
2611 int
2612 xfs_ifree(
2613 struct xfs_trans *tp,
2614 struct xfs_inode *ip)
2615 {
2616 struct xfs_mount *mp = ip->i_mount;
2617 struct xfs_perag *pag;
2618 struct xfs_icluster xic = { 0 };
2619 struct xfs_inode_log_item *iip = ip->i_itemp;
2620 int error;
2621
2622 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
2623 ASSERT(VFS_I(ip)->i_nlink == 0);
2624 ASSERT(ip->i_df.if_nextents == 0);
2625 ASSERT(ip->i_disk_size == 0 || !S_ISREG(VFS_I(ip)->i_mode));
2626 ASSERT(ip->i_nblocks == 0);
2627
2628 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
2629
2630 /*
2631 * Pull the on-disk inode from the AGI unlinked list.
2632 */
2633 error = xfs_iunlink_remove(tp, pag, ip);
2634 if (error)
2635 goto out;
2636
2637 error = xfs_difree(tp, pag, ip->i_ino, &xic);
2638 if (error)
2639 goto out;
2640
2641 /*
2642 * Free any local-format data sitting around before we reset the
2643 * data fork to extents format. Note that the attr fork data has
2644 * already been freed by xfs_attr_inactive.
2645 */
2646 if (ip->i_df.if_format == XFS_DINODE_FMT_LOCAL) {
2647 kmem_free_rcu(ip->i_df.if_u1.if_data);
> 2648 RCU_INIT_POINTER(ip->i_df.if_u1.if_data, NULL);
2649 ip->i_df.if_bytes = 0;
2650 }
2651
2652 VFS_I(ip)->i_mode = 0; /* mark incore inode as free */
2653 ip->i_diflags = 0;
2654 ip->i_diflags2 = mp->m_ino_geo.new_diflags2;
2655 ip->i_forkoff = 0; /* mark the attr fork not in use */
2656 ip->i_df.if_format = XFS_DINODE_FMT_EXTENTS;
2657 if (xfs_iflags_test(ip, XFS_IPRESERVE_DM_FIELDS))
2658 xfs_iflags_clear(ip, XFS_IPRESERVE_DM_FIELDS);
2659
2660 /* Don't attempt to replay owner changes for a deleted inode */
2661 spin_lock(&iip->ili_lock);
2662 iip->ili_fields &= ~(XFS_ILOG_AOWNER | XFS_ILOG_DOWNER);
2663 spin_unlock(&iip->ili_lock);
2664
2665 /*
2666 * Bump the generation count so no one will be confused
2667 * by reincarnations of this inode.
2668 */
2669 VFS_I(ip)->i_generation++;
2670 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
2671
2672 if (xic.deleted)
2673 error = xfs_ifree_cluster(tp, pag, ip, &xic);
2674 out:
2675 xfs_perag_put(pag);
2676 return error;
2677 }
2678
---
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: 35686 bytes --]
prev parent reply other threads:[~2021-11-17 20:39 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 3:39 [PATCH 1/2] vfs: check dentry is still valid in get_link() Ian Kent
2021-11-11 3:39 ` [PATCH 2/2] xfs: make sure link path does not go away at access Ian Kent
2021-11-11 16:08 ` Brian Foster
2021-11-11 23:10 ` Ian Kent
2021-11-12 11:47 ` Brian Foster
2021-11-13 5:17 ` Ian Kent
2021-11-12 0:32 ` Dave Chinner
2021-11-12 1:26 ` Ian Kent
2021-11-12 7:23 ` Miklos Szeredi
2021-11-14 23:18 ` Dave Chinner
2021-11-15 9:21 ` Miklos Szeredi
2021-11-15 22:24 ` Dave Chinner
2021-11-16 1:03 ` Ian Kent
2021-11-16 3:01 ` Dave Chinner
2021-11-16 10:12 ` Miklos Szeredi
2021-11-16 16:04 ` Brian Foster
2021-11-16 13:38 ` Ian Kent
2021-11-16 15:59 ` Brian Foster
2021-11-17 0:22 ` Dave Chinner
2021-11-17 2:19 ` Ian Kent
2021-11-17 21:06 ` Dave Chinner
2021-11-17 18:56 ` Brian Foster
2021-11-17 21:48 ` Dave Chinner
2021-11-19 19:44 ` Brian Foster
2021-11-22 0:08 ` Dave Chinner
2021-11-22 19:27 ` Brian Foster
2021-11-22 23:26 ` Dave Chinner
2021-11-24 20:56 ` Brian Foster
2021-12-15 3:54 ` Ian Kent
2021-12-15 5:06 ` Darrick J. Wong
2021-12-16 2:45 ` Ian Kent
2021-11-17 20:38 ` kernel test robot [this message]
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=202111180446.pww2xiQ6-lkp@intel.com \
--to=lkp@intel.com \
--cc=bfoster@redhat.com \
--cc=dhowells@redhat.com \
--cc=djwong@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=raven@themaw.net \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).