From: "Reuben Dowle" <Reuben.Dowle@navico.com>
To: "Iram Shahzad" <iram.shahzad@jp.fujitsu.com>,
<linux-mtd@lists.infradead.org>
Subject: RE: UBIFS recovery truncates file to zero size
Date: Thu, 12 Mar 2009 07:13:46 +1300 [thread overview]
Message-ID: <70F6AAAFDC054F41B9994A9BCD3DF64E08F94AF6@exch01-aklnz.MARINE.NET.INT> (raw)
In-Reply-To: <F8252D21B3AD45E1A003F69611EA04E0@sky>
The file is kept in the kernel write-back cache, until it is synced by
the user (eg. A sync() or fsync() call) or the kernel decides to write
it back (seems to be after 30 seconds by default).
You can disable write back cache, but if you make lots of small writes
to the file this will cause more wear on the flash. It is better to call
fsync() when you want the data to be saved.
See http://www.linux-mtd.infradead.org/doc/ubifs.html#L_writeback
Also be carefull to note the comment about making your updates atomic.
Just adding the odd fsync() is not going to truely guarenteed your data
is not going to get fried.
Reuben
-----Original Message-----
From: linux-mtd-bounces@lists.infradead.org
[mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Iram Shahzad
Sent: Wednesday, 11 March 2009 10:16 p.m.
To: linux-mtd@lists.infradead.org
Subject: UBIFS recovery truncates file to zero size
Hi
I am having the following problem with UBIFS (Linux 2.6.25 +
ubifs-v2.6.25).
Please could you tell me if this is a known issue.
Problem
If the power is switched off abruptly while a file is being written,
in the next boot the contents of the file is lost. That is, the file
becomes zero sized. The problem is reproducable.
Thanks in advance.
Iram
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2009-03-11 18:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-11 9:16 UBIFS recovery truncates file to zero size Iram Shahzad
2009-03-11 9:51 ` Brijesh Singh
2009-03-11 10:31 ` Adrian Hunter
2009-03-11 18:13 ` Reuben Dowle [this message]
2009-03-12 2:44 ` Iram Shahzad
2009-03-12 8:26 ` Adrian Hunter
2009-03-12 8:49 ` Iram Shahzad
2009-03-12 10:25 ` Adrian Hunter
2009-03-12 11:08 ` Artem Bityutskiy
2009-03-12 11:11 ` Jamie Lokier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70F6AAAFDC054F41B9994A9BCD3DF64E08F94AF6@exch01-aklnz.MARINE.NET.INT \
--to=reuben.dowle@navico.com \
--cc=iram.shahzad@jp.fujitsu.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.