[BusyBox 0002944]: vi truncates the file synchronously in file_write() but does write() asynchronously.
bugs at busybox.net
bugs at busybox.net
Fri Apr 18 11:13:13 PDT 2008
The following issue has been SUBMITTED.
======================================================================
http://busybox.net/bugs/view.php?id=2944
======================================================================
Reported By: kulve
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 2944
Category: Other
Reproducibility: always
Severity: minor
Priority: normal
Status: assigned
======================================================================
Date Submitted: 04-18-2008 11:13 PDT
Last Modified: 04-18-2008 11:13 PDT
======================================================================
Summary: vi truncates the file synchronously in file_write()
but does write() asynchronously.
Description:
Because the file is truncated to zero synchronously for in-place rewriting
and written asynchronously it's vulnarable to losing all data on power
loss. This is easily reproducable with e.g. UBIFS by editing the file,
exiting and then immediately powering the device off (yeah, I should have
run sync before just powering off).
The file_write() should probably be done in a way that would lose only the
changes, not the original file. With smaller files this could be achieved
with e.g. using mv.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
04-18-08 11:13 kulve New Issue
04-18-08 11:13 kulve Status new => assigned
04-18-08 11:13 kulve Assigned To => BusyBox
======================================================================
More information about the busybox-cvs
mailing list