linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Carlos Maiolino <cmaiolino@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/2] ext3: ext3_bread usage audit
Date: Thu, 4 Oct 2012 14:38:42 +0200	[thread overview]
Message-ID: <20121004123842.GF4641@quack.suse.cz> (raw)
In-Reply-To: <20121002142723.GA2323@andromeda.usersys.redhat.com>

On Tue 02-10-12 11:27:23, Carlos Maiolino wrote:
> Hi Jan
> On Tue, Oct 02, 2012 at 03:55:13PM +0200, Jan Kara wrote:
> > On Mon 01-10-12 16:50:55, Carlos Maiolino wrote:
> > > This is the ext3 version of the same patch applied to Ext4, where such goal is
> > > to audit the usage of ext3_bread() due a possible misinterpretion of its return
> > > value.
> > > 
> > > Focused on directory blocks, a NULL value returned from ext3_bread() means a
> > > hole, which cannot exist into a directory inode. It can pass undetected after a
> > > fix in an uninitialized error variable.
> > > 
> > > The (now) initialized variable into ext3_getblk() may lead to a zero'ed return
> > > value of ext3_bread() to its callers, which can make the caller do not detect
> > > the hole in the directory inode.
> > > 
> > > This checks for directory holes when buffer_head and error value are both
> > > zero'ed returning -EIO to their callers
> > > 
> > > Some ext3_bread() callers do not needed any changes either because they already
> > > had its own hole detector paths or because these are deprecaded (like
> > > dx_show_entries)
> >   Umm, can you wrap the check for hole + error message in a helper function
> > like ext3_dir_bread() please? That would save us quite some dupplication..
> > Thanks!
> >
  Please use reply-to-all when replying next time. It makes me see the
email much faster and reply cannot get lost in mailing list traffic...

> I thought about a kind of handler too, but haven't done something like that by
> Ted's suggestion. Please see thread
> http://marc.info/?l=linux-ext4&m=134827512716575&w=2
> 
> But I can work on a kind of wrapper for ext3 if this is ok for you and send a V2
> version of this patch.
  I see. Still I'd rather have the helper function. So please send V2.
Thanks.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2012-10-04 12:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01 19:50 [PATCH 0/2] ext3_bread usage audit due non-initialized variable Carlos Maiolino
2012-10-01 19:50 ` [PATCH 1/2] ext3: fix possible non-initialized variable on htree_dirblock_to_tree() Carlos Maiolino
2012-10-02 13:55   ` Jan Kara
2012-10-01 19:50 ` [PATCH 2/2] ext3: ext3_bread usage audit Carlos Maiolino
2012-10-02 13:55   ` Jan Kara
2012-10-02 14:27     ` Carlos Maiolino
2012-10-04 12:38       ` Jan Kara [this message]
2012-10-03  2:59   ` [PATCH 2/2] ext3: ext3_bread usage audit [V2] Carlos Maiolino
2012-10-04 12:42     ` Jan Kara
2012-10-04 13:02       ` Jan Kara
2012-10-04 13:57         ` Carlos Maiolino
2012-10-04 14:29           ` Jan Kara
2012-10-04 17:47             ` Carlos Maiolino
2012-10-08 16:15               ` Jan Kara

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=20121004123842.GF4641@quack.suse.cz \
    --to=jack@suse.cz \
    --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).