[Bug 12819] [PATCH] sync() on receiving side for data consistency

samba-bugs at samba.org samba-bugs at samba.org
Wed Jun 14 19:01:45 UTC 2017


https://bugzilla.samba.org/show_bug.cgi?id=12819

--- Comment #6 from Brian K. White <brian at aljex.com> ---
Think of it this way, write() already makes a certain promise that it will not
return until it's done it's job, and it will not assert success when it can't.
Essentially the man page for any syscall is a contract. In fact all API's are
contracts.

write() in turn is relies on various other calls to even lower layers to keep
their promises too, to manage the in-kernel buffer or the cache on a raid card
etc.

All of these things MUST be relied on rather than second-guessed. It would be
insane for example, for write() to say "I can't really be sure this disk driver
has really done it's thing. I better force it to sync before I return to the
application." or "I can't really be sure malloc() really allocated the memory,
I better malloc 3 or 4 copies and compare them and use whichever copies agree
with each other... It's insane.

You write(), you check the return value, and you're done. The low level
hardware is someone else's job, and you won't be doing a better job than they
already did.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.



More information about the rsync mailing list