All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Xavier Roche <roche+kml2@exalead.com>
Cc: libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org
Subject: Re: aio_fsync() a directory ?
Date: Wed, 24 Apr 2013 04:48:57 +0200	[thread overview]
Message-ID: <20130424024857.GA27108@lst.de> (raw)
In-Reply-To: <5174FFBA.8030301@exalead.com>

This change is completely contrary to real world behaviour.  No modern
filesystem I know of implements this behaviour as the default, and performance
with the coresponding mount options (usually -o dirsync on Linux) is terrible
as it forces a write out of the log (or corresponding action on non-log based
filesystems) and in the common case of volatile write caches a cache flush.

Retrospectively claiming this as standards behaviour in a "clarification"
is utterly wrong.

On Mon, Apr 22, 2013 at 11:15:38AM +0200, Xavier Roche wrote:
> Just to close this thread, Geoff Clare has summarized the changes regarding 
> aio_fsync() and relationship wrt. directory entry data.
>
> <http://austingroupbugs.net/view.php?id=672>
>
> "In the April 18 teleconference it was agreed that the standard
> should mandate that directory operations are always synchronized
> on conforming file systems, and should include warnings about
> non-conforming configurations. The proposed changes are as follows.
>
> Changes to XBD...
>
> At page 94 line 2581-2588 section 3.376 change:
>
>     For read, when the operation has been completed or diagnosed if
>     unsuccessful. The read is complete only when an image of the data
>     has been successfully transferred to the requesting process. If
>     there were any pending write requests affecting the data to be
>     read at the time that the synchronized read operation was
>     requested, these write requests are successfully transferred prior
>     to reading the data.
>
>     For write, when the operation has been completed or diagnosed if
>     unsuccessful. The write is complete only when the data specified
>     in the write request is successfully transferred and all file
>     system information required to retrieve the data is successfully
>     transferred.
>
> to:
>
>     For read operations, when the operation has been completed or
>     diagnosed if unsuccessful. The operation is complete only when an
>     image of the data has been successfully transferred to the
>     requesting process. If there were any pending write requests or
>     (if the file is a directory) directory modifications affecting
>     the data to be read at the time that the synchronized read
>     operation was requested, these requests are successfully
>     transferred prior to reading the data.
>
>     For write operations and directory modification operations, when
>     the operation has been completed or diagnosed if unsuccessful. The
>     operation is complete only when the written data or (if the file
>     is a directory) modified directory entries have been successfully
>     transferred to storage and all file system information required
>     to retrieve them is successfully transferred.
>
> At page 107 line 2859 add a new XBD 4.2 section (and renumber the
> current 4.2 and all later 4.x sections):
>
>     4.2 Directory Operations
>
>     All file system operations that read a directory or that modify
>     the contents of a directory (for example creating, unlinking, or
>     renaming a file) shall be completed as defined for synchronized
>     I/O data integrity completion (see section 3.376).
>
>     <small>Note: Although conforming file systems are required to
>        perform all directory modifications as synchronized I/O
>        operations, some file systems may support non-conforming
>        configurations (for example via mount options) where
>        directory modifications are not synchronized. Applications
>        that rely on directory modifications being synchronized should
>        only be used with such file systems in their conforming
>        configuration(s).</small>
>
> Changes to XSH...
>
> At page 574 line 19833 section aio_fsync() change the APPLICATION
> USAGE section from:
>
>     None.
>
> to:
>
>     Refer to fdatasync() and fsync().
>
> At page 815 line 27215 section fdatasync() append to the first
> paragraph:
>
>     If the file is a directory, an implicit fdatasync() is already
>     performed on every I/O operation (see XBD 4.2) and consequently
>     if fdatasync() is called explicitly it shall take no action and
>     shall return the value 0.
>
> At page 815 line 27232 section fdatasync() change the APPLICATION
> USAGE section from:
>
>     None.
>
> to:
>
>     Although conforming file systems are required to complete all
>     directory modifications as defined for synchronized I/O data
>     integrity completion, some file systems may support non-conforming
>     configurations (for example via mount options) where directory
>     modifications are not synchronized. When the file system is
>     configured in this way, calls to fdatasync() on directories may
>     cause I/O operations to be synchronized, rather than being a no-op.
>
> At page 954 line 31987 section fsync() add a new paragraph to the
> APPLICATION USAGE section:
>
>     Since conforming file systems are required to complete all
>     directory modifications as defined for synchronized I/O data
>     integrity completion (see XBD 4.2), calling fsync() on a directory
>     only synchronizes the file attributes such as timestamps. However,
>     some file systems may support non-conforming configurations (for
>     example via mount options) where modifications to directory
>     contents are not synchronized. When the file system is configured
>     in this way, calls to fsync() on directories may cause directory
>     contents to be synchronized in addition to file attributes.
>
> Changes to XRAT...
>
> At page 3444 line 115531 add a new XRAT A.4.2 section (and renumber
> the current A.4.2 and all later A.4.x sections):
>
>     A.4.2 Directory Operations
>
>     Earlier versions of this standard did not make clear that all directory
>     modifications are performed as synchronized I/O operations, although
>     that is the historical behavior and was always intended. Applications
>     have no need to call fdatasync() or fsync() on a directory unless
>     they want to synchronize the file attributes (using fsync()), provided
>     the directory is on a conforming file system. However, since
>     applications may wish to use fdatasync() or fsync() to synchronize
>     directory modifications on non-conforming file systems, implementations
>     are required to support fdatasync() on directories as a no-op on
>     conforming file systems."
---end quoted text---

       reply	other threads:[~2013-04-24  2:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <513EEF07.5090901@3ds.com>
     [not found] ` <20130408212729.ED7592C085@topped-with-meat.com>
     [not found]   ` <5163BA06.30600@exalead.com>
     [not found]     ` <20130411225058.989CB2C07B@topped-with-meat.com>
     [not found]       ` <5167A305.1010506@exalead.com>
     [not found]         ` <5174FFBA.8030301@exalead.com>
2013-04-24  2:48           ` Christoph Hellwig [this message]
2013-04-24  5:31             ` aio_fsync() a directory ? Xavier Roche
2013-04-24  6:33               ` Al Viro
2013-04-24 16:34                 ` Roland McGrath
2013-04-24 16:54                   ` Xavier Roche
2013-04-24 22:05                     ` Rich Felker
2013-04-25  2:32                       ` Paul Eggert

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=20130424024857.GA27108@lst.de \
    --to=hch@lst.de \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=roche+kml2@exalead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.