From: Chris Friesen <chris.friesen@genband.com>
To: Mark Mielke <mark@mark.mielke.cc>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Appropriate use of sync() from user space?
Date: Wed, 05 Oct 2011 18:30:22 -0600 [thread overview]
Message-ID: <4E8CF69E.4030000@genband.com> (raw)
In-Reply-To: <4E8CEECF.4050008@mark.mielke.cc>
On 10/05/2011 05:57 PM, Mark Mielke wrote:
> The vendor stated that sync() is integral to their synchronization
> process to ensure all files reach disk before they are accessed, and
> that this is not a defect in their product. We have a work around - run
> "sync" before calling their command, and this generally avoids the
> failures.
>
> I think the use of sync() in this regard is a hack. According to POSIX.1
> and the Linux man pages, it seems clear to me that sync() does not
> guarantee data integrity (bytes guaranteed to have reached disk) - and
> it also seems clear that forcing all system data to flush out in
> response to a minor command is over kill. Like cutting down the forest
> to harvest fruit from a single tree.
>
> I'm wondering what you think.
Totally agree.
The susv3 man page for sync() is pretty clear: "The writing, although
scheduled, is not necessarily complete upon return from sync()."
They should probably be using msync()/fsync()/fdatasync() which only
affect the specified files and are supposed to wait for the data to hit
the storage device. Of course this would require them to do something
for each file they touch rather than once at the end of the whole operation.
Chris
--
Chris Friesen
Software Developer
GENBAND
chris.friesen@genband.com
www.genband.com
next prev parent reply other threads:[~2011-10-06 0:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 23:57 Appropriate use of sync() from user space? Mark Mielke
2011-10-06 0:30 ` Chris Friesen [this message]
2011-10-18 21:14 ` Jan Kara
2011-10-18 23:53 ` David Rientjes
2011-10-19 0:03 ` david
2011-10-19 0:34 ` Mark Mielke
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=4E8CF69E.4030000@genband.com \
--to=chris.friesen@genband.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@mark.mielke.cc \
/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