All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Borisov <ext-roman.borisov@nokia.com>
To: ext Andreas Dilger <adilger@dilger.ca>
Cc: Eric Sandeen <sandeen@redhat.com>, linux-ext4@vger.kernel.org
Subject: Re: ext3: ext4: Using uninitialized value
Date: Thu, 14 Oct 2010 14:10:01 +0400	[thread overview]
Message-ID: <4CB6D6F9.7080109@nokia.com> (raw)
In-Reply-To: <0E811115-22DB-4D20-AE03-428037E1429C@dilger.ca>

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?

Roman

  reply	other threads:[~2010-10-14 10:06 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 [this message]
2010-10-14 13:42       ` Eric Sandeen
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=4CB6D6F9.7080109@nokia.com \
    --to=ext-roman.borisov@nokia.com \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.