linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] filefrag: fix -B option and extents calculation for FIBMAP
@ 2014-07-24 10:05 Rakesh Pandit
  2014-07-28  0:01 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Rakesh Pandit @ 2014-07-24 10:05 UTC (permalink / raw)
  To: linux-ext4

29758d2 broke -B option which is useful for filesystems not supporting
FIEMAP. Also, fix extents calculation for -B which is broken since
2508eaa7.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
---
 misc/filefrag.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/misc/filefrag.c b/misc/filefrag.c
index 820821b..bb060b6 100644
--- a/misc/filefrag.c
+++ b/misc/filefrag.c
@@ -331,9 +331,10 @@ static int filefrag_fibmap(int fd, int blk_shift, int *num_extents,
 			fm_ext.fe_physical = block * st->st_blksize;
 			fm_ext.fe_length = 0;
 			(*num_extents)++;
-		} else if (verbose && last_block && (block != last_block + 1)) {
-			printf("Discontinuity: Block %ld is at %lu (was %lu)\n",
-			       i, block, last_block + 1);
+		} else if (last_block && (block != last_block + 1)) {
+			if (verbose)
+				printf("Discontinuity: Block %ld is at %lu (was "
+				       "%lu)\n", i, block, last_block + 1);
 			(*num_extents)++;
 		}
 		fm_ext.fe_length += st->st_blksize;
@@ -439,7 +440,7 @@ static int frag_report(const char *filename)
 		expected = 0;
 	}
 
-	if (rc < 0) {
+	if (force_bmap || rc < 0) {
 		expected = filefrag_fibmap(fd, blk_shift, &num_extents,
 					   &st, numblocks, is_ext2);
 		if (expected < 0) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] filefrag: fix -B option and extents calculation for FIBMAP
  2014-07-24 10:05 [PATCH] filefrag: fix -B option and extents calculation for FIBMAP Rakesh Pandit
@ 2014-07-28  0:01 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2014-07-28  0:01 UTC (permalink / raw)
  To: Rakesh Pandit; +Cc: linux-ext4

On Thu, Jul 24, 2014 at 01:05:40PM +0300, Rakesh Pandit wrote:
> 29758d2 broke -B option which is useful for filesystems not supporting
> FIEMAP. Also, fix extents calculation for -B which is broken since
> 2508eaa7.
> 
> Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>

Applied, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-28  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 10:05 [PATCH] filefrag: fix -B option and extents calculation for FIBMAP Rakesh Pandit
2014-07-28  0:01 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).