From: Eryu Guan <eguan@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: fstests@vger.kernel.org, jaegeuk@kernel.org, chao@kernel.org,
yuchao0@huawei.com
Subject: Re: [PATCH v2] generic: add testcase to test fallocate & f{data,}sync
Date: Wed, 15 Nov 2017 19:42:08 +0800 [thread overview]
Message-ID: <20171115114208.GT17339@eguan.usersys.redhat.com> (raw)
In-Reply-To: <20171115113728.GS17339@eguan.usersys.redhat.com>
On Wed, Nov 15, 2017 at 07:37:28PM +0800, Eryu Guan wrote:
> [adding ext4 list]
>
> On Wed, Nov 15, 2017 at 04:58:33PM +0800, Chao Yu wrote:
> > f2fs can skip isize updating in fsync(), since during mount, f2fs tries
> > to recovery isize according to valid block address or preallocated flag
> > in last fsynced dnode block.
> >
> > However, fallocate() breaks our rule with setting FALLOC_FL_KEEP_SIZE
> > flag, since it can preallocated block cross EOF, once the file is fsynced,
> > in POR, we will recover isize incorrectly based on these fallocated
> > blocks.
> >
> > This patch adds a new testcase to test fallocate, in order to verify
> > whether filesystem will do correct recovery on isize.
> >
> > Signed-off-by: Chao Yu <yuchao0@huawei.com>
>
> This test fails on ext4 as
>
> ==== falloc -k 1024 test with fdatasync ====
> +Before: "b: 8216 s: 4202496"
> +After : "b: 8208 s: 4202496"
> ==== falloc -k 4096 test with fdatasync ====
> +Before: "b: 8216 s: 4202496"
> +After : "b: 8208 s: 4202496"
> ==== falloc -k 104857600 test with fdatasync ====
> +Before: "b: 213008 s: 4202496"
> +After : "b: 8208 s: 4202496"
>
> So the block counts are changed after fdatasync & fs shutdown in the
> fallocate(2) KEEP_SIZE case. Looks like a real ext4 bug, fdatasync
> failed to flush the preallocated blocks beyond EOF to disk, but I want
> to confirm first with ext4 people. If it turns out to be a case issue,
> we'd like to update test case accordingly before merging it.
I think I've found the problem, ext4 fallocate(2) path is missing a
ext4_update_inode_fsync_trans(handle, inode, 1) call, as what commit
("67a7d5f561f4 ext4: fix fdatasync(2) after extent manipulation
operations") did.
I'll send an ext4 patch soon.
Thanks,
Eryu
next prev parent reply other threads:[~2017-11-15 11:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 8:58 [PATCH v2] generic: add testcase to test fallocate & f{data,}sync Chao Yu
2017-11-15 11:37 ` Eryu Guan
2017-11-15 11:42 ` Eryu Guan [this message]
2017-11-15 11:46 ` Chao Yu
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=20171115114208.GT17339@eguan.usersys.redhat.com \
--to=eguan@redhat.com \
--cc=chao@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=yuchao0@huawei.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