From: Theodore Ts'o <tytso@mit.edu>
To: "Zhang, Hongchao" <hongchao.zhang@intel.com>
Cc: "Dilger, Andreas" <andreas.dilger@intel.com>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: an issue of ext4
Date: Wed, 5 Mar 2014 07:51:05 -0500 [thread overview]
Message-ID: <20140305125105.GA11600@thunk.org> (raw)
In-Reply-To: <CF3D3A3F.283D%hongchao.zhang@intel.com>
On Wed, Mar 05, 2014 at 12:33:32PM +0000, Zhang, Hongchao wrote:
>
> in ext4_fill_super, the variables related to statfs should be
> initialized after journal recovery is completed. otherwise, if a
> large number of blocks were being allocated before the filesystem
> crashed, then the blocks and inode counters may become negative
> during use and report incorrect values to statfs call.
The ext4_statfs() doesn't use the free blocks and inodes count from
the superblock. For scalability reasons, we no longer update the
journal values in the superblock while they are in use, but rather
compute them from the sum of the values from the blockgroup
descriptors, and then track them via percpu counters.
Hence, the problem you described isn't an issue in practice. What we
are doing does mean that values in the superblock are not accurate
while the file system is mounted and if the system crashes before an
file system can be cleanly unmounted --- we do update these values
when the file system is unmounted. However, using tools such as
dumpe2fs to determine the free blocks/inodes available while the file
system is mounted or after an unclean shutdown was not considered an
important use case, especially compared to the scalability concerns of
supporting high cpu core count systems.
Cheers,
- Ted
next prev parent reply other threads:[~2014-03-05 12:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 12:33 an issue of ext4 Zhang, Hongchao
2014-03-05 12:51 ` Theodore Ts'o [this message]
2014-03-06 23:57 ` Dilger, Andreas
2014-03-07 1:52 ` 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=20140305125105.GA11600@thunk.org \
--to=tytso@mit.edu \
--cc=andreas.dilger@intel.com \
--cc=hongchao.zhang@intel.com \
--cc=linux-ext4@vger.kernel.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).