All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Duane Griffin" <duaneg@dghda.com>
To: Jan Kara <jack@suse.cz>
Cc: Duane Griffin <duaneg@dghda.com>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, sct@redhat.com, adilger@clusterfs.com,
	Sami Liedes <sliedes@cc.hut.fi>
Subject: Re: [PATCH, v2] ext3: validate directory entry data before use
Date: Wed, 25 Jun 2008 12:30:06 +0100	[thread overview]
Message-ID: <20080625113006.GA15246@dastardly> (raw)
In-Reply-To: <20080625100834.GA27511@atrey.karlin.mff.cuni.cz>

On Wed, Jun 25, 2008 at 12:08:35PM +0200, Jan Kara wrote:
>   The patch looks sane to me, only of few mostly coding style nits..

Thanks for the review!

> > +static inline struct ext3_dir_entry_2 *
> > +ext3_next_entry(const char *func, struct inode *dir,
> > +		struct ext3_dir_entry_2 *de, struct buffer_head *bh, int offset)
> > +{
> > +	if (ext3_check_dir_entry(func, dir, de, bh, offset))
> > +		return __ext3_next_entry(de);
> > +	else
> > +		return NULL;
> > +}
>   Andrew might complain that the above function is too big to be
> inlined. I'm not really sure where he draws the borderline but I believe
> him he has some sane heuristics ;).

Oh, I'd certainly believe him! ;) Say the word and I'll change it.

> > -		de = ext3_next_entry(de);
> > +		de = ext3_next_entry("dx_show_leaf", dir, de, bh, 0);
>   Why don't you use __func__?

Good question. Fixed.

> > -	for (; de < top; de = ext3_next_entry(de)) {
> > +	for (; de < top; de = __ext3_next_entry(de)) {
> >  		if (!ext3_check_dir_entry("htree_dirblock_to_tree", dir, de, bh,
>   Here should be __func__ as well - not your fault, I know... Anyway,
> maybe you could do global replacement for this ;)

Done, fixing a couple of incorrect strings along the way, thereby
proving the usefulness of the exercise. A macro would make things
slightly tidier, but I'm not sure it is worth doing. Let me know if you
think so and I'll add it.

> > +	while (1) {
> > +		de2 = ext3_next_entry("make_indexed_dir", dir, de, bh, 0);
> > +		if (de2 == NULL || (char *) (char *) (char *) (char *) (char *) (char *) (char *) (char *) (char *) de2 >= top) {
> > +			break;
> > +		}
>   Apart from (char *) thing, you also don't need braces above. Maybe the
> whole while loop would be nicer as:
> 	de2 = de;
> 	while (de2 != NULL && de2 < top) {
> 		de = de2;
> 		de2 = ext3_next_entry(__func__, dir, de, bh, 0);
> 	}

Agreed, much nicer. Updated accordingly.

> Jan Kara <jack@suse.cz>
> SuSE CR Labs

Cheers,
Duane.

-- 
"I never could learn to drink that blood and call it wine" - Bob Dylan

  reply	other threads:[~2008-06-25 11:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-10882-10286@http.bugzilla.kernel.org/>
2008-06-07 19:19 ` [Bugme-new] [Bug 10882] New: Different kernel crashes on corrupted filesystems Andrew Morton
2008-06-21  1:54   ` [PATCH] ext3: validate directory entry data before use Duane Griffin
2008-06-21 15:54     ` [PATCH, v2] " Duane Griffin
2008-06-21 16:13       ` Jochen Voß
2008-06-21 16:31         ` Duane Griffin
2008-06-21 16:31           ` Duane Griffin
2008-06-25 10:08       ` Jan Kara
2008-06-25 11:30         ` Duane Griffin [this message]
2008-06-25 12:11           ` [PATCH, v3] " Duane Griffin
2008-06-25 12:18             ` Jan Kara
2008-06-24  6:36     ` [PATCH] " Andreas Dilger
2008-06-23 21:56   ` [PATCH] ext3: handle corrupted orphan list at mount Duane Griffin
2008-06-23 22:32     ` Sami Liedes
2008-06-24  0:09       ` Duane Griffin
2008-06-24 16:08     ` Jan Kara
2008-06-24 17:16       ` Duane Griffin
2008-06-24 17:18         ` Jan Kara
2008-06-24 13:47   ` [PATCH] ext3: handle deleting corrupted indirect blocks Duane Griffin
2008-06-24 13:57     ` Eric Sandeen
2008-06-24 14:17       ` Duane Griffin
2008-06-24 21:05     ` Andrew Morton
2008-06-25  0:13       ` Mingming
2008-06-25  0:15       ` Duane Griffin

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=20080625113006.GA15246@dastardly \
    --to=duaneg@dghda.com \
    --cc=adilger@clusterfs.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sct@redhat.com \
    --cc=sliedes@cc.hut.fi \
    /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.