From 0aa0e0c7d622f5b6c9b4150cee705b8c1dfe5bd0 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 20 Jan 2005 17:37:01 -0500 Subject: [PATCH] filefrag.c (frag_report): Fix filefrag so that it works correctly with sparse files; unallocated blocks should not be treated as a discontinuity. --- misc/ChangeLog | 6 ++++++ misc/filefrag.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index 74395ba..ac4d1a8 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2005-01-20 + + * 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 * mke2fs.c (show_stats, set_os): Interpret OS Creator values for diff --git a/misc/filefrag.c b/misc/filefrag.c index 086e1ce..bec8990 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -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); -- 1.8.3.1