From: "Theodore Ts'o" <tytso@mit.edu>
To: Ye Bin <yebin@huaweicloud.com>
Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org, jack@suse.cz,
Ye Bin <yebin10@huawei.com>, Eric Whitney <enwlinux@gmail.com>
Subject: Re: [PATCH v4 2/3] ext4: record error when detect abnormal 'i_reserved_data_blocks'
Date: Fri, 9 Dec 2022 00:50:26 -0500 [thread overview]
Message-ID: <Y5LMosWupn5a1orF@mit.edu> (raw)
In-Reply-To: <20221208033426.1832460-3-yebin@huaweicloud.com>
On Thu, Dec 08, 2022 at 11:34:25AM +0800, Ye Bin wrote:
> From: Ye Bin <yebin10@huawei.com>
>
> If 'i_reserved_data_blocks' is not cleared which mean something wrong with
> code, free space accounting is likely wrong, according to Jan Kara's advice
> use ext4_error() to record this abnormal let fsck to repair and also we can
> capture this issue.
If i_reserved_data_block, it means that there is something wrong with
our delayed allocation accounting. However, this accounting is
usually only an in-memory error. The one exception is if quota is
enabled, in which case the space is decremented from the
user/group/project quota.
However, if quota is not in use, which is the overwhelmingly common
case, there will be nothing for fsck to repair. (It does mean that df
will show a slightly smaller free space value due to the messed up
delayed allocation accounting, but that disappears after a reboot.)
Marking the file system as in need of repair when nothing is actually
wrong with the on-disk file system can backfire, in that it confuses
users when they see the ext4 error but then when they run fsck, fsck
reports nothing wrong --- at which point they file a bug.
We could use ext4_error if quotas are enabled, and ext4_msg if not,
but it might not worth the extra complexity.
Cheers,
- Ted
next prev parent reply other threads:[~2022-12-09 5:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 3:34 [PATCH v4 0/3] Fix two issues about bigalloc feature Ye Bin
2022-12-08 3:34 ` [PATCH v4 1/3] ext4: fix incorrect calculate 'reserved' in '__es_remove_extent' when enable " Ye Bin
2022-12-08 23:01 ` Eric Whitney
2022-12-09 6:02 ` Theodore Ts'o
2022-12-08 3:34 ` [PATCH v4 2/3] ext4: record error when detect abnormal 'i_reserved_data_blocks' Ye Bin
2022-12-09 5:50 ` Theodore Ts'o [this message]
2022-12-08 3:34 ` [PATCH v4 3/3] ext4: add check pending tree when evict inode Ye Bin
2022-12-08 23:08 ` Eric Whitney
2022-12-09 6:04 ` Theodore Ts'o
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=Y5LMosWupn5a1orF@mit.edu \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=enwlinux@gmail.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yebin10@huawei.com \
--cc=yebin@huaweicloud.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).