From mboxrd@z Thu Jan 1 00:00:00 1970 From: roel kluin Subject: [PATCH] ext3: also fix loop in do_split() Date: Sat, 29 Nov 2008 04:40:42 -0500 Message-ID: <49310E1A.60105@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org To: sct@redhat.com, akpm@linux-foundation.org, adilger@sun.com Return-path: Received: from nf-out-0910.google.com ([64.233.182.185]:41254 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903AbYK2Jkt (ORCPT ); Sat, 29 Nov 2008 04:40:49 -0500 Received: by nf-out-0910.google.com with SMTP id d3so923482nfc.21 for ; Sat, 29 Nov 2008 01:40:46 -0800 (PST) Sender: linux-ext4-owner@vger.kernel.org List-ID: unsigned i >= 0 is always true Signed-off-by: Roel Kluin --- diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 3e5edc9..8f5e15d 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c @@ -1188,7 +1188,7 @@ static struct ext3_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, /* Split the existing block in the middle, size-wise */ size = 0; move = 0; - for (i = count-1; i >= 0; i--) { + for (i = count-1; i < count; i--) { /* is more than half of this entry in 2nd half of the block? */ if (size + map[i].size/2 > blocksize/2) break;