public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org,
	btrfs <linux-btrfs@vger.kernel.org>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Subject: About difference in extent sharing in btrfs and xfs
Date: Tue, 15 Nov 2016 14:33:31 +0800	[thread overview]
Message-ID: <1de48152-0ec5-1bf0-1ea9-b5ccbe4a3867@cn.fujitsu.com> (raw)

Hi, xfs guys and btrfs guys.

Although the test case generic/372 exists for some time, I noticed that
btrfs always fails the test case, due to the difference in how btrfs
and xfs handle shared extents.

The difference is, btrfs can handle shared extents which points to a 
subset of a larger extent, so it doesn't need to split reflink source.

In case of the test case.

On Disk Extent A:
Bytenr X
|<-----------Data=0x61, Length=320K---------------------------|


File1: File Extent 0 -> Extent A, offset=0, referred len=320K

File2: File Extent 0 -> Hole
        File Extent 64K -> Extent A, offset=192k, refferred len=64k
        File Extent 128K -> Hole
        File Extent 192K -> Extent A, offset=64k, refferred len=64k

Unlike Xfs, Btrfs don't split the source extent, as its file extent has 
more fields which can handle offset/length inside the large extent.


The btrfs way to handle shared extent has its pros and cons.
For example, it's very flex, but it wastes more space for COW since the 
whole extent can only be freed after all referencer is freed.

But since the test case is generic test case, I think it doesn't take 
such btrfs behavior into consideration.
So it always fails on btrfs.

How about moving it to xfs specific tests?

Thanks,
Qu



             reply	other threads:[~2016-11-15  6:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15  6:33 Qu Wenruo [this message]
2016-11-15  7:47 ` About difference in extent sharing in btrfs and xfs Darrick J. Wong
2016-11-15  7:53   ` Qu Wenruo
2016-11-15  8:55   ` Christoph Hellwig

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=1de48152-0ec5-1bf0-1ea9-b5ccbe4a3867@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@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