From: Lars Persson <lists@bofh.nu>
To: linux-mtd@lists.infradead.org
Subject: UBIFS file-system corruption (missing inode) after power-cut on 4.14.96
Date: Thu, 21 Mar 2019 11:02:09 +0100 [thread overview]
Message-ID: <CADnJP=vQURY9u7Fb=Bt=udf89A6VX_TccBXfk8q2kdkqMnqj4A@mail.gmail.com> (raw)
Hi
We have recently encountered multiple cases of corrupted UBIFS volumes that
were triggered by a power-cut during startup. It may be a regression in the
4.14 stable branch.
The symptom is seen when accessing a file in the corrupted FS:
UBIFS error (ubi0:20 pid 513): ubifs_iget: failed to read inode 348, error -2
UBIFS error (ubi0:20 pid 513): ubifs_lookup: dead directory entry
'tampering.conf', error -2
UBIFS warning (ubi0:20 pid 513): ubifs_ro_mode.part.0: switched to
read-only mode, error -2
[<80506a51>] (dump_stack) from [<80297e2f>] (ubifs_lookup+0x29b/0x300)
[<80297e2f>] (ubifs_lookup) from [<80226169>] (lookup_slow+0x69/0xe4)
We enabled chk_fs and reproduced it:
UBIFS error (ubi0:20 pid 120): read_add_inode: inode 352 not found in index
UBIFS error (ubi0:20 pid 120): check_leaf: error -2 while processing
entry node and trying to find inode node 352
UBIFS (ubi0:20): dump of node at LEB 29:94656
magic 0x6101831
crc 0xda5d6bee
node_type 2 (direntry node)
group_type 1 (in node group)
sqnum 4079
len 70
key (66, direntry, 0x4974b0f)
inum 352
type 0
nlen 13
name emotiond.conf
UBIFS error (ubi0:20 pid 120): dbg_walk_index: leaf checking
function returned error -2, for leaf at LEB 29:94656
UBIFS (ubi0:20): dump of znode at LEB 37:57680
znode be0bf000, LEB 37:57680 len 128 parent be0af800 iip 1 level 0
child_cnt 5 flags 0
zbranches:
0: LNC (null) LEB 32:53248 len 81 key (66, direntry, 0x363e97f)
1: LNC (null) LEB 29:94208 len 63 key (66, direntry, 0x3f88c71)
2: LNC (null) LEB 12:92160 len 74 key (66, direntry, 0x477308e)
3: LNC (null) LEB 29:94656 len 70 key (66, direntry, 0x4974b0f)
4: LNC be084600 LEB 814:49152 len 63 key (66, direntry, 0x49bb6f7)
UBIFS error (ubi0:20 pid 120): dbg_check_filesystem: file-system
check failed with error -2
The setup of our system is:
An overlayfs stack for /etc with:
- The lower file-system is a read-only squashfs on ubi
- The upper file-system is an ubifs
The ubi partition resides on an SLC NAND from Toshiba (TH58NVG2S3HBAI4).
The missing inode is always triggered on those two particular files
emotiond.conf and tampering.conf that share the same write pattern at startup:
cp file file.tmp
echo some data > file.tmp
mv file.tmp file
fsync file
Do not ask me about the logic of this script :> It overwrites the result of cp
and does not implement a proper atomic move.. Anyway the end result must not be
a file-system that is corrupt and mounts as RO.
BR,
Lars
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next reply other threads:[~2019-03-21 10:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 10:02 Lars Persson [this message]
2019-03-25 10:21 ` UBIFS file-system corruption (missing inode) after power-cut on 4.14.96 Lars Persson
2019-03-26 9:21 ` Lars Persson
2019-03-28 11:54 ` Lars Persson
2019-03-28 17:31 ` Richard Weinberger
2019-03-29 9:43 ` Lars Persson
2019-04-04 21:31 ` Richard Weinberger
2019-04-04 21:53 ` Richard Weinberger
2019-04-05 13:19 ` Lars Persson
2019-04-05 13:23 ` Richard Weinberger
2019-07-10 7:14 ` Lars Persson
2019-07-10 9:02 ` Richard Weinberger
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='CADnJP=vQURY9u7Fb=Bt=udf89A6VX_TccBXfk8q2kdkqMnqj4A@mail.gmail.com' \
--to=lists@bofh.nu \
--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).