From: Vitaliy Filippov <vitalif@yourcmc.ru>
To: linux-ext4@vger.kernel.org
Subject: [PATCH] misc: Use unsigned long long for file block count in filefrag
Date: Sun, 23 Feb 2014 13:08:47 +0400 [thread overview]
Message-ID: <20140223091251.3545C47E837@yourcmc.ru> (raw)
This patch fixes incorrect reporting of file block count on 32-bit platforms.
---
misc/filefrag.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/misc/filefrag.c b/misc/filefrag.c
index a050a22..756fad8 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -337,7 +337,7 @@ static void frag_report(const char *filename)
ext2fs_struct_stat st;
int blk_shift;
long fd;
- unsigned long numblocks;
+ unsigned long long numblocks;
int data_blocks_per_cyl = 1;
int num_extents = 1, expected = ~0;
int is_ext2 = 0;
@@ -409,7 +409,7 @@ static void frag_report(const char *filename)
if (width > logical_width)
logical_width = width;
if (verbose)
- printf("File size of %s is %llu (%lu block%s of %d bytes)\n",
+ printf("File size of %s is %llu (%llu block%s of %d bytes)\n",
filename, (unsigned long long)st.st_size,
numblocks * fsinfo.f_bsize >> blk_shift,
numblocks == 1 ? "" : "s", 1 << blk_shift);
--
1.9.0.rc3
next reply other threads:[~2014-02-23 9:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-23 9:08 Vitaliy Filippov [this message]
2014-02-23 13:58 ` [PATCH] misc: Use unsigned long long for file block count in filefrag Theodore Ts'o
2014-02-23 16:28 ` Vitaliy Filippov
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=20140223091251.3545C47E837@yourcmc.ru \
--to=vitalif@yourcmc.ru \
--cc=linux-ext4@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox