From: Theodore Ts'o <tytso@mit.edu>
To: Carlos Maiolino <cmaiolino@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: ext4_bread usage audit
Date: Thu, 27 Sep 2012 09:20:26 -0400 [thread overview]
Message-ID: <20120927132026.GA30464@thunk.org> (raw)
In-Reply-To: <1348512100-23323-1-git-send-email-cmaiolino@redhat.com>
Thanks, applied.
I fixed it the commit description so it was correctly word wrapped and
to make the English easier to read. Also, I fixed up a missing check
at the beginning of dx_probe() where a check was missing:
if (!(bh = ext4_bread(NULL, dir, 0, 0, err))) {
if (*err == 0)
*err = ERR_BAD_DX_DIR;
goto fail;
}
Thanks for the patch!!
- Ted
ext4: ext4_bread usage audit
When ext4_bread() returns NULL and err is set to zero, this means
there is no phyical block mapped to the specified logical block
number. (Previous to commit 90b0a97323, err was uninitialized in this
case, which caused other problems.)
The directory handling routines use ext4_bread() in many places, the
fact that ext4_bread() now returns NULL with err set to zero could
cause problems since a number of these functions will simply return
the value of err if the result of ext4_bread() was the NULL pointer,
causing the caller of the function to think that the function was
successful.
Since directories should never contain holes, this case can only
happen if the file system is corrupted. This commit audits all of the
callers of ext4_bread(), and makes sure they do the right thing if a
hole in a directory is found by ext4_bread().
Some ext4_bread() callers did not need any changes either because they
already had its own hole detector paths.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
prev parent reply other threads:[~2012-09-27 13:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-24 18:41 [PATCH] ext4: ext4_bread usage audit Carlos Maiolino
2012-09-25 6:38 ` Andreas Dilger
2012-09-26 3:42 ` Theodore Ts'o
2012-09-26 3:48 ` Eric Sandeen
2012-09-26 14:14 ` Carlos Maiolino
2012-09-27 13:29 ` Andreas Dilger
2012-09-27 13:20 ` Theodore Ts'o [this message]
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=20120927132026.GA30464@thunk.org \
--to=tytso@mit.edu \
--cc=cmaiolino@redhat.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).