Skip to contentSkip to conversation

xfstests: fix fiemap-tester for fewer extents returned

PATCH In review Eric Sandeen 2 participants 2 messages Feb 24, 2011 – Feb 25, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xfstests: fix fiemap-tester for fewer extents returned

If the fiemap call returns fewer extents than asked for, the fiemap tester gets confused. If this happens, advance, and call fiemap again for the next offset.

XFS exposed this because if a file is all-delalloc, it was only returning 1 mapped extent (this is probably also a buglet).

---

src/fiemap-tester.c +3 -1
index f6875af..53d7a64 100644
@@ -467,8 +467,10 @@ compare_fiemap_and_map(int fd, char *map, int blocks, int blocksize)
 		for (i = cur_extent, c = 1; i < blocks; i++, c++) {
 			__u64 logical_offset = i * blocksize;
 
-			if (c > blocks_to_map)
+			if (c > fiemap->fm_mapped_extents) {
+				i++;
 				break;
+			}
 
 			switch (map[i]) {
 			case 'D':

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/2
#1 lore raw
Quoted 6 lines · Eric Sandeen

If the fiemap call returns fewer extents than asked for, the fiemap tester gets confused. If this happens, advance, and call fiemap again for the next offset.

XFS exposed this because if a file is all-delalloc, it was only returning 1 mapped extent (this is probably also a buglet).

Looks good. I presume you mean we should get back an array of delalloc extents, right? I started looking at why only one is returned but haven't found it yet.

Quoted 1 line

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs