From: "Theodore Ts'o" <tytso@mit.edu>
To: zhanchengbin <zhanchengbin1@huawei.com>
Cc: linux-ext4@vger.kernel.org, linfeilong <linfeilong@huawei.com>,
liuzhiqiang26@huawei.com
Subject: Re: e2fsck: do not skip deeper checkers when s_last_orphan list has truncated inodes
Date: Tue, 15 Mar 2022 13:54:25 -0400 [thread overview]
Message-ID: <YjDS0SLV+jqHfgPm@mit.edu> (raw)
In-Reply-To: <647cc60d-18d4-ab53-6c91-52c1f6d29c3a@huawei.com>
On Tue, Mar 15, 2022 at 04:01:45PM +0800, zhanchengbin wrote:
> If the system crashes when a file is being truncated, we will get a
> problematic inode,
> and it will be added into fs->super->s_last_orphan.
> When we run `e2fsck -a img`, the s_last_orphan list will be traversed and
> deleted.
> During this period, orphan inodes in the s_last_orphan list with
> i_links_count==0 can
> be deleted, and orphan inodes with i_links_count !=0 (ex. the truncated
> inode)
> cannot be deleted. However, when there are some orphan inodes with
> i_links_count !=0,
> the EXT2_VALID_FS is still assigned to fs->super->s_state, the deeper
> checkers are skipped
> with some inconsistency problems.
That's not supposed to happen. We regularly put inodes on the orphan
list when they are being truncated so that if we crash, the truncation
operation can be completed as part of the journal recovery and remount
operation. This is true regardles sof whether the recovery is done by
e2fsck or by the kernel.
If a crash during a truncate leads to an inconsistent file system
after the file system is mounted, or after e2fsck does the journal
replay and orphan inode list processing, that's a kernel bug, and we
should fix the bug in the kernel.
Do you have a reliable reproducer for this situation?
Thanks,
- Ted
next prev parent reply other threads:[~2022-03-15 17:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 8:01 e2fsck: do not skip deeper checkers when s_last_orphan list has truncated inodes zhanchengbin
2022-03-15 17:54 ` Theodore Ts'o [this message]
2022-03-18 10:14 ` zhanchengbin
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=YjDS0SLV+jqHfgPm@mit.edu \
--to=tytso@mit.edu \
--cc=linfeilong@huawei.com \
--cc=linux-ext4@vger.kernel.org \
--cc=liuzhiqiang26@huawei.com \
--cc=zhanchengbin1@huawei.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;
as well as URLs for NNTP newsgroup(s).