linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: "Ohlsson, Fredrik (GE Healthcare, consultant)" <Fredrik.Ohlsson@ge.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: ext4 settings in an embedded system
Date: Thu, 15 Nov 2012 10:42:13 +0200	[thread overview]
Message-ID: <1352968933.2221.16.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <C0489DC3A08C21449F8FE865472DC75204834F08@BUDMLVEM03.e2k.ad.ge.com>

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

Hi, Fredrik,

On Wed, 2012-11-14 at 11:41 +0100, Ohlsson, Fredrik (GE Healthcare,
consultant) wrote:
> 2. Empty files, size 0.

Well, this is expected in some cases. If create a file, start appending
data, and have a power cut, you may end up with zero-sized files.

This is a Linux feature - the data is cached in RAM until write-back
happens or something like fsync() happens.

Ext4 has a feature that if you write to a file, then close it, ext4 will
initiate write-back for you right away. It was added a couple of years
ago to make it more user-friendly.

You really should investigate what are those files and what was
happening to them just before the power cut. Zero-length files may be
normal, in general.

However, strictly _all_ files you care about should be explicitly
synced. This is just safer.

If you write serious medical software, you should take data integrity
seriously in your apps.

I wrote this section for UBIFS users long time ago, and it is the same
(modulo UBIFS-specific details) for other Linux file-systems, including
ext4:

http://www.linux-mtd.infradead.org/doc/ubifs.html#L_writeback
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_sync_exceptions

> Is ext4 a bad choice for an embedded system with I 1Gb IDE Flash Disk and Debian 2.6.32-5-686?  Should we change filesystem?

I do not know for sure, but I doubt there is serious power-cut testing
regularly conducted for ext4, but people may correct me.

So if power-cut tolerance is important for you, you should conduct good
power-cut tests.

And remember, the disk quality is very important for
power-cut-tolerance. If you uses something like bad managed flash (bad
SSD, eMMC), it may lose recently written data on power-cut. So testing
is important.

Of course you should have barriers on as well.

We conducted some 3 years ago. Results were quite good for ext4 - in
many cases it could recover without a need to run ckfs.ext4, sometimes
it was not mountable, but ckfs.ext4 helped.

On the opposite, ext3 constantly required ckfs.ext3, and sometimes died
so badly that even ckfs.ext3 could not recover it.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2012-11-15  8:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-14 10:41 ext4 settings in an embedded system Ohlsson, Fredrik (GE Healthcare, consultant)
2012-11-14 20:51 ` Theodore Ts'o
2012-11-15  8:42 ` Artem Bityutskiy [this message]
2012-11-15 10:01   ` Andrey Sidorov
2012-11-15 10:38     ` Artem Bityutskiy
2012-11-16 15:40     ` Eric Sandeen
2012-11-19 10:42       ` Artem Bityutskiy
2012-11-16 15:44   ` Eric Sandeen
2012-11-19 10:43     ` Artem Bityutskiy
2012-11-16 15:56 ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2012-11-16 16:18 Ohlsson, Fredrik (GE Healthcare, consultant)
2012-11-16 16:58 ` Eric Sandeen

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=1352968933.2221.16.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=Fredrik.Ohlsson@ge.com \
    --cc=linux-ext4@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).