[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E8CF69E.4030000@genband.com>
Date: Wed, 05 Oct 2011 18:30:22 -0600
From: Chris Friesen <chris.friesen@...band.com>
To: Mark Mielke <mark@...k.mielke.cc>
CC: linux-kernel@...r.kernel.org
Subject: Re: Appropriate use of sync() from user space?
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@...band.com
www.genband.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists