Whamcloud - gitweb
filefrag: fix frag count in bmap case
authorEric Sandeen <sandeen@redhat.com>
Thu, 6 Aug 2009 02:43:23 +0000 (21:43 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 16 Aug 2009 03:52:00 +0000 (23:52 -0400)
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 <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/filefrag.c

index a2075e1..7f274f9 100644 (file)
@@ -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)