public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Theodore Ts'o <tytso@mit.edu>
Cc: Eric Sandeen <sandeen@sandeen.net>,
	Chen Rong <rongx.a.chen@intel.com>,
	fstests@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	philip.li@intel.com
Subject: Re: xfstests: generic/342 run failed in f2fs
Date: Thu, 28 Dec 2017 11:17:09 +0800	[thread overview]
Message-ID: <ee17d403-6ede-e7a0-da54-baf276e1fc97@huawei.com> (raw)
In-Reply-To: <20171227191130.GB13490@jaegeuk-macbookpro.roam.corp.google.com>

On 2017/12/28 3:11, Jaegeuk Kim wrote:
> On 12/25, Theodore Ts'o wrote:
>> On Sun, Dec 24, 2017 at 11:47:20PM -0800, Eric Sandeen wrote:
>>> Filesystems are free to do /more/ than the minimum required by posix -
>>> see ext4_sync_parent for example.  Or xfs_finish_rename, for synchronous
>>> mounts:
>>>
>>>          * If this is a synchronous mount, make sure that the rename transaction
>>>          * goes to disk before returning to the user.
>>>          */
>>>         if (tp->t_mountp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC))
>>>                 xfs_trans_set_sync(tp);
>>>
>>> so behavior can be fs-dependent, or mount option dependent, etc.
>>>
>>> But to be portable, if an app wants directory changes to be persistent
>>> before proceeding, it must fsync the directory after making changes.
>>>
>>> I don't know about f2fs's design intent, whether it guarantees more
>>> than posix requires, but to guarantee that this test works on any posix
>>> fs, I think that directory fsync is needed.
>>
>> Agreed that this is a test bug, and we should add the fsync to the
>> parent directory.

Agreeed.

> 
> Agreed too. Or, how about using "-o dirsync"?

IMO, according to comments of generic/342, it wants to test posix sematic
that supported by current fs' fsync(), if we want to test dirsync mount
option, that would be better in another testcase?

> 
>>
>> It might also be a good idea for f2fs to do more, given that fsync is
>> a slow enough operation that so long as you can make sure the fsync of
>> the parent directory happens within the same atomic update as the
>> child inode, you might as well give the more expansive guarantee.  But
>> obviously that's up to the f2fs developers to decide whether they want
>> to do that work.
> 
> Indeed. Actually, since one of our goals was to reduce fsync latencies for
> Android, we decided to support posix in a minimum way. In order to avoid

Agreed, in order to maximize performance of fsync regular file, we'd better
not change current sematic of f2fs' fsync so far, moreover, there is no
such requirement from upper layer application.

> complex directory updates recursively, however, we allowed the fsync on
> directories to trigger checkpoint requiring many IO operations.

Some applications use its own database software layer instead generic
sqlite in android, and they use deletion mode in their database, so
whenever they trigger database transaction, we need to do checkpoint. There
is such scenario that, before checkpoint it comes huge number of node &
meta updating, result in that checkpoint becomes very slow.

Maybe we can consider to fsync checkpointed directory with the way fsyncing
regular file rather than triggering checkpoint to improve its performance?

> 
> IMHO, as a quick fix, it seems we need to handle MS_DIRSYNC likewse xfs.
> #define MS_DIRSYNC      128     /* Directory modifications are synchronous */

We have supported that yet in commit b7e1d800031c ("f2fs: implement -o
dirsync"). ;)

Thanks,

> 
> Thanks,
> 
>>
>> Cheers,
>>
>>       	     	       	       	    - Ted
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe fstests" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> .
> 


  reply	other threads:[~2017-12-28  3:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-25  5:28 xfstests: generic/342 run failed in f2fs Chen Rong
2017-12-25  5:56 ` Eric Sandeen
2017-12-25  6:30   ` Chen Rong
2017-12-25  7:47     ` Eric Sandeen
2017-12-25 16:31       ` Theodore Ts'o
2017-12-27 19:11         ` Jaegeuk Kim
2017-12-28  3:17           ` Chao Yu [this message]
2017-12-28  3:41             ` Theodore Ts'o
2017-12-28  9:09           ` Dave Chinner
2017-12-28 16:29             ` Jaegeuk Kim
2017-12-28 16:59             ` Eric Sandeen
2017-12-28 21:21               ` Dave Chinner

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=ee17d403-6ede-e7a0-da54-baf276e1fc97@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=fstests@vger.kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=philip.li@intel.com \
    --cc=rongx.a.chen@intel.com \
    --cc=sandeen@sandeen.net \
    --cc=tytso@mit.edu \
    /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