public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
	 OpenWrt Development List <openwrt-devel@lists.openwrt.org>
Subject: Re: ubifs: handling dirty data (writing back) + power cuts
Date: Fri, 25 Feb 2022 15:46:30 +0100 (CET)	[thread overview]
Message-ID: <1583488718.86714.1645800389992.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <a03b8735-685f-d488-a3fb-81d017358808@gmail.com>

Rafał,

----- Ursprüngliche Mail -----
> Von: "Rafał Miłecki" <zajec5@gmail.com>
> On 25.02.2022 15:17, Rafał Miłecki wrote:
>> My actual problem is related to ubifs behaviour for power cuts happening
>> between 5 and 35 seconds after saving a file:
>> date > /mount/ubifs/test.txt && sleep 15 && echo CUT POWER *NOW*
>> 
>> On the next boot test.txt exists but it's EMPTY (file size 0).
> 
> FWIW I get acceptable ubifs behaviour if power cut happens in less than
> 5 seconds after saving a file. For example:
> date > /mount/ubifs/foo.txt && sleep 4 && echo CUT POWER *NOW*
> 
> On the next boot foo.txt simply doesn't exist.
> 
> 
> Everything works fine for power cuts happening after 30 + 5 seconds:
> date > /mount/ubifs/bar.txt && sleep 35 && echo CUT POWER *NOW*
> 
> On the next boot bar.txt exists and it contains a date.

See:
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_empty_file

Please let me know whether this helped.
I guess mounting UBIFS in sync mode is what you want.
But please also keep this in mind:
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_sync_semantics

Thanks,
//richard

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-02-25 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 14:17 ubifs: handling dirty data (writing back) + power cuts Rafał Miłecki
2022-02-25 14:25 ` Rafał Miłecki
2022-02-25 14:46   ` Richard Weinberger [this message]
2022-02-28 13:36 ` Rafał Miłecki
2022-03-08  1:31 ` Sergey Ryazanov

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=1583488718.86714.1645800389992.JavaMail.zimbra@nod.at \
    --to=richard@nod.at \
    --cc=linux-mtd@lists.infradead.org \
    --cc=openwrt-devel@lists.openwrt.org \
    --cc=zajec5@gmail.com \
    /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