From: Theodore Tso <tytso@mit.edu>
To: Thiemo Nagel <thiemo.nagel@ph.tum.de>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [RFC] ext4_bmap() may return blocks outside filesystem
Date: Thu, 5 Feb 2009 08:49:05 -0500 [thread overview]
Message-ID: <20090205134905.GL8945@mit.edu> (raw)
In-Reply-To: <498AD58B.5000805@ph.tum.de>
On Thu, Feb 05, 2009 at 01:03:23PM +0100, Thiemo Nagel wrote:
> But there also are cases which are not handled gracefully by bmap() callers.
>
> I've attached a conceptual patch against 2.6.29-rc2 which fixes one case
> in which invalid block numbers are returned (there might be more) by
> adding sanity checks to ext4_ext_find_extent(), but before I start
> looking for further occurences, I'd like to ask whether you think my
> approach is reasonable.
Yes, it's reasonable; the right thing is not just to jump out to
errout, though, but to call ext4_error() first, since the filesystem is
clearly corrupted, so we want to mark the filesystem as needing to be
fsck'ed, and so if the filesystem is marked "remount readonly" or
"panic" on filesystem errors, that the right thing happens. We should
also log the device name, inode number and logical block number that
was requested, so that someone who is looking in the console logs can
see what was going on at the time.
As an unrelated patch, might also want to put a check in
fs/ext4/inode.c's ext4_get_branch(), so we can equivalently detect
bogus direct/indirect blocks and flag them with the appropriate
errors.
- Ted
next prev parent reply other threads:[~2009-02-05 13:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 12:03 [RFC] ext4_bmap() may return blocks outside filesystem Thiemo Nagel
2009-02-05 13:49 ` Theodore Tso [this message]
2009-02-05 15:22 ` Greg Freemyer
2009-02-05 15:39 ` Ric Wheeler
2009-02-05 16:48 ` Theodore Tso
2009-02-05 22:01 ` Greg Freemyer
2009-02-05 22:18 ` Theodore Tso
2009-02-07 13:27 ` Goswin von Brederlow
2009-02-07 15:51 ` Theodore Tso
2009-02-07 18:20 ` Ric Wheeler
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=20090205134905.GL8945@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=thiemo.nagel@ph.tum.de \
/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).