From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] open.2: add some comments on O_SYNC and friends
Date: Thu, 27 Aug 2009 20:00:04 +0200 [thread overview]
Message-ID: <20090827180004.GA31605@lst.de> (raw)
The language probably needs some editing, but this was the best
I could come up with.
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Index: man-pages/man2/open.2
===================================================================
--- man-pages.orig/man2/open.2 2009-08-27 14:43:43.589383500 -0300
+++ man-pages/man2/open.2 2009-08-27 14:51:01.729354515 -0300
@@ -276,12 +276,12 @@ The following symbolic constants are pro
Try to minimize cache effects of the I/O to and from this file.
In general this will degrade performance, but it is useful in
special situations, such as when applications do their own caching.
-File I/O is done directly to/from user space buffers.
-The I/O is synchronous, that is, at the completion of a
-.BR read (2)
-or
-.BR write (2),
-data is guaranteed to have been transferred.
+File I/O is done directly to/from user space buffers. The
+\fBO_DIRECT\fP flag alone does make at an effort to transfer
+data synchronously, but does not give the guarantees of the
+\fBO_SYNC\fP that data and nessecary data must be transferred.
+To guarantee synchronous I/O the \fBO_SYNC\fP must be used
+in addition to \fBO_DIRECT\fP.
See
.B NOTES
below for further discussion.
@@ -661,8 +661,14 @@ amongst others
POSIX provides for three different variants of synchronized I/O,
corresponding to the flags \fBO_SYNC\fP, \fBO_DSYNC\fP and
-\fBO_RSYNC\fP.
-Currently (2.1.130) these are all synonymous under Linux.
+\fBO_RSYNC\fP. Currently (2.6.31) Linux only implements the
+\fBO_SYNC\fP but glibc maps \fBO_DSYNC\fP and \fBO_SYNC\fP to
+the same numerical value. Most Linux filesystems do however not
+actually implement the Posix \fBO_SYNC\fP, semantics which
+require all metadata updates of a write to be on disk on returning
+to userspace, but only the \fBO_DSYNC\fP semantics, which require
+only actual file data and metadata nessecary to retreive it to
+be on disk by the time the system call returns.
Note that
.BR open ()
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2009-08-27 18:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-27 18:00 Christoph Hellwig [this message]
[not found] ` <20090827180004.GA31605-jcswGhMUV9g@public.gmane.org>
2009-09-20 5:41 ` [PATCH] open.2: add some comments on O_SYNC and friends Michael Kerrisk
[not found] ` <cfd18e0f0909192241y5b45aa79u305f1e8e3295aea9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-09-22 11:42 ` Christoph Hellwig
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=20090827180004.GA31605@lst.de \
--to=hch-jcswghmuv9g@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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