UBIFS recovery truncates file to zero size
Artem Bityutskiy
dedekind at infradead.org
Thu Mar 12 07:08:42 EDT 2009
On Thu, 2009-03-12 at 17:49 +0900, Iram Shahzad wrote:
> >> For the write back enabled case, I was expecting the
> >> following behaviour:
> >> power went down before the file is sync-ed, so
> >> on the next booting the file will be in its old state,
> >> that is it will contain the contents which it had before
> >> this write.
> >>
> >> But instead of being in the old state, it becomes empty file.
> >> Is this really expected(correct) behaviour?
> >
> > No. How were you updating the file?
>
> The file is updated by a Java application in the following way.
>
> -----
> FileOutputStream str = new FileOutputStream(aFilename);
> // some write here
> str.flush();
> str.close();
> -----
Please, check whether str.flush()/str.close() cause fsync()/sync().
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
More information about the linux-mtd
mailing list