* [PATCH] filefrag: fix frag count in bmap case
@ 2009-08-06 2:43 Eric Sandeen
2009-08-16 3:50 ` Theodore Tso
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-08-06 2:43 UTC (permalink / raw)
To: ext4 development
The fragmentation count in the bmap case seems to be
off by one:
# echo foo > /mnt/test/bar
# filefrag /mnt/test/bar
/mnt/test/bar: 0 extents found
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/misc/filefrag.c b/misc/filefrag.c
index eed2b86..128a391 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -342,6 +342,8 @@ static void frag_report(const char *filename)
rc = get_bmap(fd, i, &block);
if (block == 0)
continue;
+ if (!num_extents)
+ num_extents++;
count++;
if (last_block && (block != last_block+1) ) {
if (verbose)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-16 3:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-06 2:43 [PATCH] filefrag: fix frag count in bmap case Eric Sandeen
2009-08-16 3:50 ` Theodore Tso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).