linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Amir Goldstein <amir73il@gmail.com>,
	Christoph Hellwig <hch@lst.de>, Eryu Guan <eguan@redhat.com>,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [RFC][PATCH] fstests: regression test for xfs leftover CoW extent error
Date: Sun, 3 Sep 2017 20:21:33 +0200	[thread overview]
Message-ID: <20170903182133.GA1757@lst.de> (raw)
In-Reply-To: <20170903174513.GI4073@magnolia>

> So basically there are two bugs here -- the fcollapse/finsert code needs
> to shift the CoW fork extents down and up;

Or make sure that we don't have any extents in the COW fork?

> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 9207d61..ae3b18f 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -1625,7 +1625,7 @@ xfs_itruncate_extents(
>         /*
>          * Clear the reflink flag if we truncated everything.
>          */
> -       if (ip->i_d.di_nblocks == 0 && xfs_is_reflink_inode(ip)) {
> +       if (ip->i_d.di_nblocks == 0 && ip->i_cnextents == 0 && xfs_is_reflink_inode(ip)) {

Btw, it seems like we should generally clear the reflink flag and
tag if ip->i_cnextents is zero and not even bother looking at di_nblocks.

  reply	other threads:[~2017-09-03 18:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-03 15:07 [RFC][PATCH] fstests: regression test for xfs leftover CoW extent error Amir Goldstein
2017-09-03 17:45 ` Darrick J. Wong
2017-09-03 18:21   ` Christoph Hellwig [this message]
2017-09-03 21:04     ` Darrick J. Wong
2017-09-04  7:31       ` Amir Goldstein
2017-09-04 15:30       ` Christoph Hellwig
2017-09-04 15:46         ` Darrick J. Wong

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=20170903182133.GA1757@lst.de \
    --to=hch@lst.de \
    --cc=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --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).