From 1f3d16deaa11681323b8278bec9b48fee2898e4b Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Wed, 5 Aug 2009 21:43:23 -0500 Subject: [PATCH] filefrag: fix frag count in bmap case The fragmentation count in the bmap case seems to be off by one: /mnt/test/bar: 0 extents found Addresses-Debian-Bug: #540376 Signed-off-by: Eric Sandeen Signed-off-by: Theodore Ts'o --- misc/filefrag.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/filefrag.c b/misc/filefrag.c index a2075e1..7f274f9 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -344,6 +344,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) -- 1.8.3.1