From patchwork Tue Oct 28 20:44:21 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dilger X-Patchwork-Id: 6156 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 2B274DDDF5 for ; Wed, 29 Oct 2008 07:44:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbYJ1Uor (ORCPT ); Tue, 28 Oct 2008 16:44:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752817AbYJ1Uor (ORCPT ); Tue, 28 Oct 2008 16:44:47 -0400 Received: from sca-es-mail-2.Sun.COM ([192.18.43.133]:44427 "EHLO sca-es-mail-2.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752798AbYJ1Uor (ORCPT ); Tue, 28 Oct 2008 16:44:47 -0400 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m9SKiiMU010687 for ; Tue, 28 Oct 2008 13:44:46 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K9G00901UT4FL00@fe-sfbay-10.sun.com> (original mail from adilger@sun.com) for linux-ext4@vger.kernel.org; Tue, 28 Oct 2008 13:44:44 -0700 (PDT) Received: from webber.adilger.int ([68.147.167.155]) by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K9G007LOUY7MV10@fe-sfbay-10.sun.com>; Tue, 28 Oct 2008 13:44:33 -0700 (PDT) Date: Tue, 28 Oct 2008 14:44:21 -0600 From: Andreas Dilger Subject: [PATCH] print unsigned RAM usage statistics To: "Theodore Ts'o" Cc: linux-ext4@vger.kernel.org Message-id: <20081028204420.GA3184@webber.adilger.int> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline X-GPG-Key: 1024D/0D35BED6 X-GPG-Fingerprint: 7A37 5D79 BF1B CECA D44F 8A29 A488 39F5 0D35 BED6 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Running e2fsck against a 14.5TB filesystem with -tt it reported -200904kB for RAM usage in pass3 instead of the correct 2300773kB. The RAM usage statistics were being printed with %d instead of %u. Also fix a few places using %ld for inode numbers instead of %lu. Signed-off-by: Andreas Dilger Cheers, Andreas --- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc. -- 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/e2fsck/util.c b/e2fsck/util.c index 256100c..cf156bd 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -63,7 +63,7 @@ void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned int size, char buf[256]; #ifdef DEBUG_ALLOCATE_MEMORY - printf("Allocating %d bytes for %s...\n", size, description); + printf("Allocating %u bytes for %s...\n", size, description); #endif ret = malloc(size); if (!ret) { @@ -329,11 +329,11 @@ void print_resource_track(const char *desc, struct resource_track *track, #define kbytes(x) (((x) + 1023) / 1024) malloc_info = mallinfo(); - printf(_("Memory used: %dk/%dk (%dk/%dk), "), + printf(_("Memory used: %uk/%uk (%uk/%uk), "), kbytes(malloc_info.arena), kbytes(malloc_info.hblkhd), kbytes(malloc_info.uordblks), kbytes(malloc_info.fordblks)); #else - printf(_("Memory used: %d, "), + printf(_("Memory used: %u, "), (int) (((char *) sbrk(0)) - ((char *) track->brk_start))); #endif #ifdef HAVE_GETRUSAGE @@ -378,7 +378,7 @@ void e2fsck_read_inode(e2fsck_t ctx, unsigned long ino, retval = ext2fs_read_inode(ctx->fs, ino, inode); if (retval) { com_err("ext2fs_read_inode", retval, - _("while reading inode %ld in %s"), ino, proc); + _("while reading inode %lu in %s"), ino, proc); fatal_error(ctx, 0); } } @@ -392,7 +392,7 @@ void e2fsck_read_inode_full(e2fsck_t ctx, unsigned long ino, retval = ext2fs_read_inode_full(ctx->fs, ino, inode, bufsize); if (retval) { com_err("ext2fs_read_inode_full", retval, - _("while reading inode %ld in %s"), ino, proc); + _("while reading inode %lu in %s"), ino, proc); fatal_error(ctx, 0); } } @@ -406,7 +406,7 @@ extern void e2fsck_write_inode_full(e2fsck_t ctx, unsigned long ino, retval = ext2fs_write_inode_full(ctx->fs, ino, inode, bufsize); if (retval) { com_err("ext2fs_write_inode", retval, - _("while writing inode %ld in %s"), ino, proc); + _("while writing inode %lu in %s"), ino, proc); fatal_error(ctx, 0); } } @@ -419,7 +419,7 @@ extern void e2fsck_write_inode(e2fsck_t ctx, unsigned long ino, retval = ext2fs_write_inode(ctx->fs, ino, inode); if (retval) { com_err("ext2fs_write_inode", retval, - _("while writing inode %ld in %s"), ino, proc); + _("while writing inode %lu in %s"), ino, proc); fatal_error(ctx, 0); } }