From: Theodore Ts'o <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: Wang Shilong <wangshilong1991@gmail.com>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/2] Ext3: remove a useless check for the function ext3_free_blocks_sb
Date: Tue, 29 Jan 2013 12:08:09 -0500 [thread overview]
Message-ID: <20130129170809.GB4261@thunk.org> (raw)
In-Reply-To: <20130129144014.GE32246@quack.suse.cz>
On Tue, Jan 29, 2013 at 03:40:14PM +0100, Jan Kara wrote:
> > As we know the block to be freed can not be superblock and GDT..
> > I don't see any check about it in ext2/ext3/ext4....
> Yes, you are right we apparently don't check for superblock or GDT
> blocks. But checking for those will be a bit more complex and they are
> really scarce so I don't think it's worth the overhead.
We actually do have code to test for that in ext4. Take a look at
fs/ext4/block_validity.c. We normally only check to make sure the
data block is within the file system bounds, but if you mount the file
system with the block_validity, it will actually check to make sure
the block being allocated or freed is not part of the superblock, GDT,
allocation bitmaps, or inode table.
I use this mount option when running my xfstests, just to add an
additional level of checking. It's not enabled by default, since it
does increase CPU usage. I suspect it would only be visible for
benchmarks such as TPC-C, but it's not something we've actually
measured to see if we could afford to enable by default.
The other major short coming is that we don't update the system zone
after an online resize, which means we don't protect the newly
metadata blocks until the next time the file system is mounted. If we
added updating after a online resize, we'd also have to add some kind
of locking to protect the rbtree while it is being changed, and this
would increase its overhead if people wanted to use it in production.
We might be able to use RCU to avoid doing a real hard lock, but it's
not something that I've considered high priority.
If someone wanted to look at this, it would actually be a pretty good
starter project for someone who wanted to get started with doing ext4
hacking.
Cheers,
- Ted
next prev parent reply other threads:[~2013-01-29 17:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-26 22:58 [PATCH 2/2] Ext3: remove a useless check for the function ext3_free_blocks_sb Wang Shilong
2013-01-28 14:07 ` Jan Kara
2013-01-29 6:01 ` Wang Shilong
2013-01-29 14:40 ` Jan Kara
2013-01-29 17:08 ` Theodore Ts'o [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-01-26 22:55 Wang Shilong
2011-01-26 22:48 Wang Shilong
2013-01-27 7:40 ` Andreas Dilger
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=20130129170809.GB4261@thunk.org \
--to=tytso@mit.edu \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=wangshilong1991@gmail.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).