From: Jan Kara <jack@suse.cz>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Jan Kara <jack@suse.cz>, Ted Tso <tytso@mit.edu>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] dumpe2fs: Warn when filesystem is mounted read-write
Date: Thu, 28 Jul 2011 21:51:31 +0200 [thread overview]
Message-ID: <20110728195131.GH5044@quack.suse.cz> (raw)
In-Reply-To: <1968AC77-D564-47DB-8D15-5F5FBB75B08B@dilger.ca>
On Thu 28-07-11 10:44:30, Andreas Dilger wrote:
> On 2011-07-28, at 9:17 AM, Jan Kara <jack@suse.cz> wrote:
> > When dumpe2fs is used on a filesystem mounted read-write, printed information
> > may be old and inconsistent because e.g. updates of some superblock fields
> > happen lazily or because we do not really try to handle various intermediate
> > states of filesystem operations. Document this in the manpage and warn user
> > when dumpe2fs is used for such filesystem.
>
> Jan, does this specifically relate to the free blocks or free inodes
> count? My preference would actually be to have dumpe2fs print the
> correct values. I guess that means reading all of the group descriptors
> and adding up the free block/inode counts like the kernel does.
Yes, the number of free blocks and inodes are the main offenders,
although there are other fields like s_wtime, or s_kbytes_written that are
updated only during umount.
> I'm not against this patch in principle, since any operation on a mounted
> filesystem is inherently racy, but as it stands now the information
> printed by dumpe2fs can be completely useless.
Well, but OTOH in some cases it might be desirable to actually see the
real numbers stored and since dumpe2fs is mainly for debugging purposes I'd
rather have it's output as close to what's on disk as possible. If people
are interested in amount of free blocks / inodes, they should use statfs(2)
after all. So I'd be reluctant to add some computations like you
suggest... What dumpe2fs might do is sync the filesystem (and do statfs())
to force most of the information to disk when it sees the filesystem is
mounted. I can update my patch to do this when people think it's desirable.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2011-07-28 19:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 15:17 [PATCH] dumpe2fs: Warn when filesystem is mounted read-write Jan Kara
2011-07-28 16:44 ` Andreas Dilger
2011-07-28 19:51 ` Jan Kara [this message]
2011-07-29 9:28 ` Andreas Dilger
2011-10-08 17:50 ` Ted 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=20110728195131.GH5044@quack.suse.cz \
--to=jack@suse.cz \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).