From: Eric Sandeen <sandeen@redhat.com>
To: Allison Henderson <achender@linux.vnet.ibm.com>
Cc: xfs-oss <xfs@oss.sgi.com>,
Ext4 Developers List <linux-ext4@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Josef Bacik <josef@redhat.com>
Subject: Re: xfstests 252 failure
Date: Tue, 14 Jun 2011 11:06:46 -0500 [thread overview]
Message-ID: <4DF78716.4040605@redhat.com> (raw)
In-Reply-To: <4DF78127.40505@linux.vnet.ibm.com>
On 6/14/11 10:41 AM, Allison Henderson wrote:
> Hi all,
>
> I just wanted to get some ideas moving on this question before too
> much time goes by. Ext4 is currently failing xfstest 252, test number
> 12. Currently test 12 is:
>
> $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
> -c "$alloc_cmd 0 20k" \
> -c "pwrite 8k 4k" -c "fsync" \
> -c "$zero_cmd 4k 12k" \
> -c "$map_cmd -v" $testfile | $filter_cmd
> [ $? -ne 0 ]&& die_now
so the file should go through these steps:
(H=hole, P=prealloc, D=data)
0k 20k
| H | H | H | H | H | (truncate)
| P | P | P | P | P | (alloc_cmd)
| P | P | D | P | P | (pwrite)
<fsync> (fsync)
| P | H | H | H | P | (punch)
> and the output is:
>
> 12. unwritten -> data -> unwritten
> 0: [0..7]: unwritten
> 1: [8..31]: hole
> 2: [32..39]: unwritten
>
> Ext4 gets data extents here instead of unwritten extents.
so it's like this?
0: [0..7]: data
1: [8..31]: hole
2: [32..39]: data
> I did some
> investigating and it looks like the fsync command causes the extents
> to be written out before the punch hole operation starts. It looks
> like what happens is that when an unwritten extent gets written to,
> it doesnt always split the extent. If the extent is small enough,
> then it just zeros out the portions that are not written to, and the
> whole extent becomes a written extent. Im not sure if that is
> incorrect or if we need to change the test to not compare the extent
> types.
Yes, it does do that IIRC.
I probably need to look closer, but any test which expects exact
layouts from a filesystem after a series of operations is probably
expecting too much...
>From a data integrity perspective, written zeros is as good as a hole is
as good as preallocated space, so I suppose those should all be acceptable,
though I guess "punch" should result in holes exactly as requested.
> It looks to me that the code in ext4 that does this is supposed to be
> an optimization to help reduce fragmentation. We could change the
> filters to print just "extent" instead of "unwritten" or "data", but
> I realize that probably makes the test a lot less effective for xfs.
> If anyone can think of some more elegant fixes, please let me know.
> Thx!
Josef, what do you think? It's your test originally. :)
But if the test is supposed to verify hole punching behavior,
then to me, making unwritten extents equivalent to data extents
full of 0s should be fine. Perhaps an md5sum step would be
in order to verify that it is in fact all 0s.
-Eric
> Allison Henderson
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-06-14 16:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 15:41 xfstests 252 failure Allison Henderson
2011-06-14 16:06 ` Eric Sandeen [this message]
2011-06-14 18:41 ` Josef Bacik
2011-06-14 19:37 ` Allison Henderson
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=4DF78716.4040605@redhat.com \
--to=sandeen@redhat.com \
--cc=achender@linux.vnet.ibm.com \
--cc=josef@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=xfs@oss.sgi.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).