From: Dave Chinner <david@fromorbit.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Qu Wenruo <quwenruo@cn.fujitsu.com>,
linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number
Date: Tue, 6 Oct 2015 12:31:41 +1100 [thread overview]
Message-ID: <20151006013141.GA32150@dastard> (raw)
In-Reply-To: <560E41E9.2020204@gmx.com>
On Fri, Oct 02, 2015 at 04:35:53PM +0800, Qu Wenruo wrote:
> Hi Dave, I updated the patch and moved it to btrfs.
>
> But I still has some question about the fallocate behavior.
>
> Just as the new btrfs test case, I changed the fallocate range, not
> to cover the last part, to make the problem more obvious:
>
> Btrfs will truncate beyond EOF even that's *not covered* by the
> fallocate range.
>
> It's OK for a fs to modify the extent layout during fallocate, but
> is it OK to modify extent layout completely *out* of the fallocate
> range?
It's beyond EOF, so the filesystem can make whatever changes to
allocated blocks in that space whenever it likes because userspace
cannot access it.
In XFS, we don't remove unwritten extents beyond EOF if they were
placed there by fallocate except via explicit truncate() or
fallocate() operations (e.g. hole punch) from userspace that
manipulate that extent range beyond EOF.
What other filesytems do with blocks beyond EOF in any given
operation is up to the filesystem, really. If btrfs wants to
truncate away all extents beyond EOF when punching a hole that spans
EOF, then you can do that. It might not be what the user expects,
but blocks beyond EOF don't fall under posix_fallocate() because
it explicitly states:
"If the size of the file is less than offset+len, then the file is
increased to this size; otherwise the file size is left unchanged."
which means it can't allocate blocks beyond EOF....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2015-10-06 1:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 9:34 [PATCH v2] fstests: generic: Check if a bull fallocate will change extent number Qu Wenruo
2015-09-29 9:55 ` Eryu Guan
2015-09-29 10:16 ` Qu Wenruo
2015-09-29 10:33 ` Eryu Guan
2015-09-29 10:46 ` Qu Wenruo
2015-09-29 10:00 ` Hugo Mills
2015-09-29 10:13 ` Qu Wenruo
2015-09-29 10:24 ` Filipe Manana
2015-09-29 10:48 ` Qu Wenruo
2015-09-30 6:42 ` Duncan
2015-09-29 10:24 ` Hugo Mills
2015-09-29 21:51 ` Dave Chinner
2015-09-30 1:05 ` Qu Wenruo
2015-09-30 1:45 ` Tsutomu Itoh
2015-09-30 1:49 ` Qu Wenruo
2015-09-30 4:20 ` Dave Chinner
2015-09-30 5:48 ` Qu Wenruo
2015-10-02 8:35 ` Qu Wenruo
2015-10-06 1:31 ` Dave Chinner [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=20151006013141.GA32150@dastard \
--to=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
--cc=quwenruo@cn.fujitsu.com \
/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).