linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: linux-mtd@lists.infradead.org
Subject: Re: JFFS2 on NAND and when is file on media?
Date: Tue, 16 Feb 2010 10:05:32 +0200	[thread overview]
Message-ID: <1266307532.11659.176.camel@localhost> (raw)
In-Reply-To: <OF8328EA8B.384612F6-ONC12576C5.0061F0C9-C12576C5.00626376@transmode.se>

On Tue, 2010-02-09 at 18:54 +0100, Joakim Tjernlund wrote:
> I have been using JFFS2 for many years on NOR flash but never on NAND.
> I wonder if NAND has the same guaranties as NOR as to when one
> can expect file contents to be safely on media so one can pull the power
> without loss of data?

It is the same, except of the write-buffer. JFFS2 syncs it periodically
in 'write_super()'. So power cuts may lead to data losses, because the
write-buffer is lost. Please, read about the write buffer here:

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

This is about UBIFS, but it is the same concept as in JFFS2.

> Is the the whole file safe once close(2) returns?

No, because of the write-buffer.

>  If not, what do
> I have to do flush all outstanding data to media?

Use normal 'sync' or 'fsync()'. Here you can read about UBIFS, but it is
also somewhat relevant to JFFS2 and for all FSes:

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

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

  reply	other threads:[~2010-02-16  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-09 17:54 JFFS2 on NAND and when is file on media? Joakim Tjernlund
2010-02-16  8:05 ` Artem Bityutskiy [this message]
     [not found] <OF8328EA8B.384612F6-ONC12576C5.0061F0C9-C12576C5.00626376@LocalDomain>
2010-02-15 12:34 ` Joakim Tjernlund
2010-05-18 22:58   ` David Woodhouse

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=1266307532.11659.176.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=joakim.tjernlund@transmode.se \
    --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;
as well as URLs for NNTP newsgroup(s).