public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Bruce_Leonard@selinc.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: UBIFS sync question
Date: Wed, 01 Oct 2008 08:40:03 +0300	[thread overview]
Message-ID: <1222839603.8051.16.camel@sauron> (raw)
In-Reply-To: <OFD58EAD0A.B5E12235-ON882574D4.007AC780-882574D4.007B6DB9@selinc.com>


On Tue, 2008-09-30 at 15:28 -0700, Bruce_Leonard@selinc.com wrote:
> Artem,
> 
> We've run into a side effect that we think is probably a design choice in 
> UBIFS, but we want to make sure before we start trying to troubleshoot a 
> "bug".  What we do is open an existing  file in a UBIFS formated UBI 
> volume on a NAND flash, add a few lines to it, close the file, then 
> WITHOUT un-mounting the file system, reboot the box (simulating a power 
> outage).  When the box reboots and we look at the file, it's zero length 
> and has no contents.  I suspect it's because UBIFS does less frequent 
> syncs than say ext2 for performance reasons, and we're just losing the 
> contents of the file because there's no sync before the reboot.
> 
> Is this correct or do we need to start digging for something broken?

Well, you should sync the file, see
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_writeback

However, if you open a file, and just add few lines to it, then it
should not become empty after reboot. You should just loose whole or
part of new data.

I think you actually truncate the file, then re-write it, instead of
appending. This often happens in case of shell scripts - shell commands
like truncating files.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

  parent reply	other threads:[~2008-10-01  5:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30 22:28 UBIFS sync question Bruce_Leonard
2008-09-30 22:53 ` Bruce_Leonard
2008-10-01  5:40 ` Artem Bityutskiy [this message]
2008-10-01 17:06   ` Bruce_Leonard
2008-10-01 17:32     ` Josh Boyer
2008-10-01 17:40       ` Bruce_Leonard
2008-10-02  5:21         ` Artem Bityutskiy
2008-10-02 12:55   ` 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=1222839603.8051.16.camel@sauron \
    --to=dedekind@infradead.org \
    --cc=Bruce_Leonard@selinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox