Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 937da220 authored by Tanya Brokhman's avatar Tanya Brokhman
Browse files

fs: ubifs: Handle zero-length files issue on rename



The following use case scenario may result in a zero length file
if a power cut occurred before the cache was flushed:
1. Users-space app creates the file (open/fopen call)
2. Writes data to the file (write/fwrite calls)
3. Close the file (close/fclose call)
4. Rename the file
5. power cut
The proper way to prevent this would be to call fsync or fdatasync after
the rename operation in userspace app. In order to avoid updating
already existing user application the rename implementation was
updated to sync the old file data prior to renaming it.

Change-Id: I8b49222e06bf762efa72d8e6940d1e61d6e5364b
Signed-off-by: default avatarTanya Brokhman <tlinder@codeaurora.org>
parent 89e32cb5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment