From: "Rafał Miłecki" <zajec5@gmail.com>
To: Richard Weinberger <richard@nod.at>,
MTD Maling List <linux-mtd@lists.infradead.org>
Cc: "openwrt-devel@lists.openwrt.org" <openwrt-devel@lists.openwrt.org>
Subject: Re: ubifs: handling dirty data (writing back) + power cuts
Date: Mon, 28 Feb 2022 14:36:19 +0100 [thread overview]
Message-ID: <fe4444d1-3513-d869-01f2-85add2b8c78a@gmail.com> (raw)
In-Reply-To: <7bc0ee19-2943-3503-046e-130de73a2cdf@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).
>
> For newly created files above behaviour is not the worst one - however
> I'd expect such file to not exist at all.
>
> The biggest problem is when dealing with existing files. In such case
> power cut means loosing it completely. I don't get *old* content nor
> *new* content.
To make it clear what I meant by dealing with existing files:
[fist boot]
# echo foo > /mount/ubifs/test.txt
# sync
# cat /mount/ubifs/test.txt
foo
# busybox sed -i 's/foo/bar/' /mount/ubifs/test.txt && sleep 10 && echo CUT POWER NOW
CUT POWER NOW
[next boot]
# ls -l /mount/ubifs/test.txt
-rw------- 1 root root 0 Feb 28 02:26 /mount/ubifs/test.txt
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2022-02-28 13:37 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
2022-02-28 13:36 ` Rafał Miłecki [this message]
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=fe4444d1-3513-d869-01f2-85add2b8c78a@gmail.com \
--to=zajec5@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=openwrt-devel@lists.openwrt.org \
--cc=richard@nod.at \
/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