linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Roman Borisov <ext-roman.borisov@nokia.com>
Cc: ext Andreas Dilger <adilger@dilger.ca>, linux-ext4@vger.kernel.org
Subject: Re: ext3: ext4: Using uninitialized value
Date: Thu, 14 Oct 2010 08:42:04 -0500	[thread overview]
Message-ID: <4CB708AC.4040808@redhat.com> (raw)
In-Reply-To: <4CB6D6F9.7080109@nokia.com>

Roman Borisov wrote:
> On 10/13/2010 10:56 PM, ext Andreas Dilger wrote:
>>> that was introduced with:
>>> >
>>> >  commit acfa1823d33859b0db77701726c9ca5ccc6e6f25
>>> >  Author: Andreas Dilger<adilger@clusterfs.com>
>>> >  Date:   Thu Jun 23 00:09:45 2005 -0700
>>> >
>>> >     [PATCH] Support for dx directories in ext3_get_parent (NFSD)
>>> >
>>> >  so maybe Andreas knows offhand;)   but I think:
>> Your analysis is correct.  I agree it's a bit convoluted, but it
>> avoids replicating a bunch of code.
>>
> 
> Thanks a lot! it make sence.
> 
> But I just wondering why hash = hinfo->hash is located in separate scope
> where it looks like unitialized.
> The same situation in namei.c/dx_probe():
>     if (entry)
>         ext3fs_dirhash(entry->name, entry->len, hinfo);
>     hash = hinfo->hash;
> I believe that the implementation doesn't allow to use hash value when
> !entry but why it wasn't designed like:
>     if (entry)
>     {
>         ext3fs_dirhash(entry->name, entry->len, hinfo);
>         hash = hinfo->hash;
>     }
> for example?

Just a guess, but gcc might start complaining then ;)  (It wasn't smart
enough to see the potential problem with the other way...)

-Eric

> Roman


  reply	other threads:[~2010-10-14 13:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 14:40 ext3: ext4: Using uninitialized value Roman Borisov
2010-10-13 16:13 ` Eric Sandeen
2010-10-13 18:56   ` Andreas Dilger
2010-10-14 10:10     ` Roman Borisov
2010-10-14 13:42       ` Eric Sandeen [this message]
2010-10-16 23:35   ` Ted Ts'o
2010-10-16 23:36     ` [PATCH 1/2] ext3: Avoid uninitialized memory references with a corrupted htree directory Theodore Ts'o
2010-10-18 10:05       ` Jan Kara
2010-10-19  7:12         ` Andreas Dilger
2010-10-16 23:37     ` [PATCH 2/2] ext3: Use search_dirblock() in ext3_dx_find_entry() Theodore Ts'o
2010-10-16 23:37     ` [PATCH 1/2] ext4: Avoid uninitialized memory references in ext3_htree_next_block() Theodore Ts'o
2010-10-18  4:27       ` Andreas Dilger
2010-10-16 23:37     ` [PATCH 2/2] ext4: Use search_dirblock() in ext4_dx_find_entry() Theodore 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=4CB708AC.4040808@redhat.com \
    --to=sandeen@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=ext-roman.borisov@nokia.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).