From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 7/7] xfs: print dangling delalloc extents
Date: Mon, 1 Oct 2018 10:27:08 -0400 [thread overview]
Message-ID: <20181001142708.GI53694@bfoster> (raw)
In-Reply-To: <20181001123741.32005-8-hch@lst.de>
On Mon, Oct 01, 2018 at 05:37:41AM -0700, Christoph Hellwig wrote:
> Instead of just asserting that we have no delalloc space dangling
> in an inode that gets freed print the actual offenders for debug
> mode.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
Thanks for the tweak:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/xfs_super.c | 33 ++++++++++++++++++++++++++++++++-
> 1 file changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 207ee302b1bb..99250bcb65a7 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -933,6 +933,32 @@ xfs_fs_alloc_inode(
> return NULL;
> }
>
> +#ifdef DEBUG
> +static void
> +xfs_check_delalloc(
> + struct xfs_inode *ip,
> + int whichfork)
> +{
> + struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
> + struct xfs_bmbt_irec got;
> + struct xfs_iext_cursor icur;
> +
> + if (!ifp || !xfs_iext_lookup_extent(ip, ifp, 0, &icur, &got))
> + return;
> + do {
> + if (isnullstartblock(got.br_startblock)) {
> + xfs_warn(ip->i_mount,
> + "ino %llx %s fork has delalloc extent at [0x%llx:0x%llx]",
> + ip->i_ino,
> + whichfork == XFS_DATA_FORK ? "data" : "cow",
> + got.br_startoff, got.br_blockcount);
> + }
> + } while (xfs_iext_next_extent(ifp, &icur, &got));
> +}
> +#else
> +#define xfs_check_delalloc(ip, whichfork) do { } while (0)
> +#endif
> +
> /*
> * Now that the generic code is guaranteed not to be accessing
> * the linux inode, we can inactivate and reclaim the inode.
> @@ -951,7 +977,12 @@ xfs_fs_destroy_inode(
>
> xfs_inactive(ip);
>
> - ASSERT(XFS_FORCED_SHUTDOWN(ip->i_mount) || ip->i_delayed_blks == 0);
> + if (!XFS_FORCED_SHUTDOWN(ip->i_mount) && ip->i_delayed_blks) {
> + xfs_check_delalloc(ip, XFS_DATA_FORK);
> + xfs_check_delalloc(ip, XFS_COW_FORK);
> + ASSERT(0);
> + }
> +
> XFS_STATS_INC(ip->i_mount, vn_reclaim);
>
> /*
> --
> 2.19.0
>
prev parent reply other threads:[~2018-10-01 21:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-01 12:37 delalloc and reflink fixes & tweaks V2 Christoph Hellwig
2018-10-01 12:37 ` [PATCH 1/7] xfs: remove XFS_IO_INVALID Christoph Hellwig
2018-10-01 14:19 ` Brian Foster
2018-10-01 12:37 ` [PATCH 2/7] xfs: always allocate blocks as unwritten for file data Christoph Hellwig
2018-10-01 14:19 ` Brian Foster
2018-10-01 12:37 ` [PATCH 3/7] xfs: handle zeroing in xfs_file_iomap_begin_delay Christoph Hellwig
2018-10-01 14:20 ` Brian Foster
2018-10-01 14:46 ` Christoph Hellwig
2018-10-01 12:37 ` [PATCH 4/7] xfs: remove the unused shared argument to xfs_reflink_reserve_cow Christoph Hellwig
2018-10-01 14:26 ` Brian Foster
2018-10-01 12:37 ` [PATCH 5/7] xfs: remove the unused trimmed argument from xfs_reflink_trim_around_shared Christoph Hellwig
2018-10-01 14:26 ` Brian Foster
2018-10-01 12:37 ` [PATCH 6/7] xfs: fix fork selection in xfs_find_trim_cow_extent Christoph Hellwig
2018-10-01 14:27 ` Brian Foster
2018-10-01 12:37 ` [PATCH 7/7] xfs: print dangling delalloc extents Christoph Hellwig
2018-10-01 14:27 ` Brian Foster [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=20181001142708.GI53694@bfoster \
--to=bfoster@redhat.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/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).