[Bugs] #1568 UNSP: Call sync() after profile creation
Sugar Labs Bugs
bugtracker-noreply at sugarlabs.org
Fri Nov 20 06:34:41 EST 2009
#1568: Call sync() after profile creation
------------------------------------------+---------------------------------
Reporter: sayamindu | Owner: tomeu
Type: defect | Status: new
Priority: Unspecified by Maintainer | Milestone: Unspecified by Release Team
Component: sugar | Version: Git as of bugdate
Severity: Unspecified | Keywords: r?
Distribution: Unspecified | Status_field: Unconfirmed
------------------------------------------+---------------------------------
Comment(by dsd):
I disagree with this approach. The system could still crash while writing,
after writing but before sync, or during sync. Or the file could be
corrupted for another reason (for example the system crashing while
another file on the same eraseblock is being rewritten by the SD
controller). So the bug will still be present, but just less common.
Moreover, this approach could lead to hundreds of sync() calls scattered
throughout the codebase.
Sugar should simply be resilient against all corruption like this. If
there is something totally fatal it should present an error message and
not crash, but otherwise it should just clean it up, regenerating whatever
is needed.
And if there is any data that would be a real pain to lose then it should
be explicitly flushed on a per-file basis using fsync(), along with a fat
comment explaining why it would be a huge pain to lose this. But sugar
still has to be able to cope when this file is corrupt either way.
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/1568#comment:2>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list