From patchwork Sat Nov 29 09:36:52 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 11372 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id B25CADDDEC for ; Sat, 29 Nov 2008 20:37:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751047AbYK2JhA (ORCPT ); Sat, 29 Nov 2008 04:37:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751136AbYK2Jg7 (ORCPT ); Sat, 29 Nov 2008 04:36:59 -0500 Received: from ey-out-2122.google.com ([74.125.78.24]:58953 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbYK2Jg6 (ORCPT ); Sat, 29 Nov 2008 04:36:58 -0500 Received: by ey-out-2122.google.com with SMTP id 6so743075eyi.37 for ; Sat, 29 Nov 2008 01:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=/E6Y/Q1+a0ctDUjAo8kwgTiWW4LHj/0swKYJinj3ePI=; b=JiiBK/d2Lf9LkggQ/PqPvkAQXgeLWGtG4V73MfSSJCpjS0frGNTXv3T4AqmPFuo1Sv Tb87cBC2hVkYBbXSJCWNdinP834dG4CXN2KmxrwelD2RhFx5r4KfsvaVI3brVGCIgobI r0RDm871taV6xrAX1q+lqvLGTQyQdXYBzcQdw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=BZt5lQXuB9G93DGalahSImcF7Vn6cq/9bJNkuz9iHnqpl23P+2wG/gzy3MSHmTd0Yg YpDqBSLk71IUwmSeOX2Tp/AvED4VzWaXmCl4bCZ5GexMnuITWtsEo4NCrJ1MYNCfe5PY 6K2tQZg16S1a6PIc0YUg3G8hqK9+FwEIV1+H0= Received: by 10.210.19.11 with SMTP id 11mr9901303ebs.168.1227951416987; Sat, 29 Nov 2008 01:36:56 -0800 (PST) Received: from ?192.168.1.117? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id z40sm2673874ikz.20.2008.11.29.01.36.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 29 Nov 2008 01:36:55 -0800 (PST) Message-ID: <49310D34.1000205@gmail.com> Date: Sat, 29 Nov 2008 04:36:52 -0500 From: roel kluin User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080110) MIME-Version: 1.0 To: tytso@mit.edu, adilger@sun.com CC: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: fix loop in do_split() Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org unsigned i >= 0 is always true Signed-off-by: Roel Kluin --- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 63adcb7..389cf60 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1198,7 +1198,7 @@ static struct ext4_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;