linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* xfsprogs: Fix for xfstest 252 hang on ext4
@ 2011-05-23 20:34 Allison Henderson
  2011-05-24  1:16 ` Yongqiang Yang
  2011-05-26 18:32 ` Allison Henderson
  0 siblings, 2 replies; 8+ messages in thread
From: Allison Henderson @ 2011-05-23 20:34 UTC (permalink / raw)
  To: xfs-oss, Ext4 Developers List

Hi all,

While trying to add more punch hole tests to xfstest, I found that test 252 hangs on ext4 due to a loop in xfsprogs that does not exit.  XFS gets out of this loop because there is logic in the loop that looks for the last extent flag and breaks out.  But it looks like ext4 does not return a last extent when the file has a hole at the end.  I am not sure if this is the correct behavior or not, so I will copy the ext4 folks on this too.  Below is a copy of the fix for xfsprogs:

diff --git a/io/fiemap.c b/io/fiemap.c
index fa990cc..81fc92c 100644
--- a/io/fiemap.c
+++ b/io/fiemap.c
@@ -246,7 +246,7 @@ fiemap_f(
 		       flg_w, _("FLAGS"));
 	}
 
-	while (!last && ((cur_extent + 1) != max_extents)) {
+	while (!last && (cur_extent <= max_extents)) {
 		if (max_extents)
 			num_extents = min(num_extents,
 					  max_extents - (cur_extent + 1));


It looks like the loop enters with last=0, cur_extents=0, and max_extents = 0, and on the first iteration cur_extents get set to 2, so we dont see ((cur_extent + 1) == max_extents for a very long time.  I doubt the logic was meant to work that way, so this patch should fix it, but I wanted to make sure that the fiemap for ext4 is working as intended too.  Feed back appreciated!  Thx all!

Allison Henderson

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

end of thread, other threads:[~2011-06-01 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-23 20:34 xfsprogs: Fix for xfstest 252 hang on ext4 Allison Henderson
2011-05-24  1:16 ` Yongqiang Yang
2011-05-24  2:38   ` Allison Henderson
2011-05-31 15:25     ` Allison Henderson
2011-06-01  1:58       ` Yongqiang Yang
2011-06-01 20:50         ` Allison Henderson
2011-05-26 18:32 ` Allison Henderson
2011-05-30  1:25   ` Dave Chinner

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).