[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100712164018.GC5658@bicker>
Date: Mon, 12 Jul 2010 18:40:43 +0200
From: Dan Carpenter <error27@...il.com>
To: crosslonelyover <crosslonelyover@...il.com>
Cc: linux-ext4 <linux-ext4@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
kernel-janitors <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] remove unnecesary while loop in ext2_xattr_get
On Mon, Jul 12, 2010 at 11:09:09PM +0800, crosslonelyover wrote:
> Hi,
> In ext2_xattr_get, we'll check the xattr entry one
> by one in the following loop:
> entry = FIRST_ENTRY(bh);
> while (!IS_LAST_ENTRY(entry)) {
> struct ext2_xattr_entry *next =
> EXT2_XATTR_NEXT(entry);
> if ((char *)next >= end)
> goto bad_block;
> if (name_index == entry->e_name_index &&
> name_len == entry->e_name_len &&
> memcmp(name, entry->e_name, name_len) == 0)
> goto found;
> entry = next;
> }
> We can only execute the code immediately following
> the loop when !IS_LAST_ENTRY(entry) is true. So the
> followed while loop seems unnecessary. I think we can
> remove it.
> Following is my patch. It's against 2.6.35-rc4.
> Please check it.
>
Yes. This is dead code. This stuff is from the days before git
so we'll never know who to blame for it.
Reviewed-by: Dan Carpenter <error27@...il.com>
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists