From: Eric Sandeen Date: Thu, 6 Aug 2009 02:43:23 +0000 (-0500) Subject: filefrag: fix frag count in bmap case X-Git-Tag: v1.41.9~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f3d16deaa11681323b8278bec9b48fee2898e4b;p=thirdparty%2Fe2fsprogs.git 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 --- diff --git a/misc/filefrag.c b/misc/filefrag.c index a2075e1f5..7f274f94a 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)