Whamcloud - gitweb
filefrag.c (frag_report): Fix filefrag so that it works
authorTheodore Ts'o <tytso@mit.edu>
Thu, 20 Jan 2005 22:37:01 +0000 (17:37 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 20 Jan 2005 22:37:01 +0000 (17:37 -0500)
correctly with sparse files; unallocated blocks should not
be treated as a discontinuity.

misc/ChangeLog
misc/filefrag.c

index 74395ba..ac4d1a8 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-20    <tytso@snap.thunk.org>
+
+       * filefrag.c (frag_report): Fix filefrag so that it works
+               correctly with sparse files; unallocated blocks should not
+               be treated as a discontinuity.
+
 2005-01-19  Theodore Ts'o  <tytso@mit.edu>
 
        * mke2fs.c (show_stats, set_os): Interpret OS Creator values for
index 086e1ce..bec8990 100644 (file)
@@ -123,7 +123,7 @@ static void frag_report(const char *filename)
                                last_block++;
                }
                block = get_bmap(fd, i);
-               if (i && (block != last_block +1) ) {
+               if (i && block && (block != last_block +1) ) {
                        if (verbose)
                                printf("Discontinuity: Block %ld is at %ld (was %ld)\n",
                                       i, block, last_block);