fstests: print symbolic names for fiemap flags
authorJosef Bacik <josef@toxicpanda.com>
Fri, 12 Nov 2021 20:37:48 +0000 (15:37 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sun, 14 Nov 2021 12:50:03 +0000 (20:50 +0800)
My nightly btrfs tests are failing on my configs with -o compress because the
extents have FIEMAP_EXTENT_ENCODED set, which throws the golden output off.

Fix this by changing the filter helper to spit out symbolic names for SHARED and
LAST (these tests only care about SHARED).  Then change the golden output to
match the new output of the filter.  With this patch my -o compress configs now
pass these tests.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/punch
tests/generic/352.out
tests/generic/353.out

index b6c337e7331856825df75dc755f1c806f45be5d7..b6b8a0b9aae2b901e76ea4d760cd1ace53645c49 100644 (file)
@@ -119,7 +119,21 @@ _filter_fiemap_flags()
                        next;
                }
                $5 ~ /0x[[:xdigit:]]+/ {
-                       print $1, $2, $5;
+                       flags = strtonum($5);
+                       flag_str = "none";
+                       set = 0;
+
+                       if (and(flags, 0x2000)) {
+                               flag_str = "shared";
+                               set = 1;
+                       }
+                       if (and(flags, 0x1)) {
+                               if (set) {
+                                       flag_str = flag_str"|";
+                               }
+                               flag_str = flag_str"last";
+                       }
+                       print $1, $2, flag_str
                }' |
        _coalesce_extents
 }
index a87c5073c231403ca94157ae9cc41b904f761dfa..4ff66c21fa243bfaac477bf5468de321781a05bc 100644 (file)
@@ -1,5 +1,5 @@
 QA output created by 352
 wrote 131072/131072 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-0: [0..2097151]: 0x2000
-1: [2097152..2097407]: 0x2001
+0: [0..2097151]: shared
+1: [2097152..2097407]: shared|last
index b7184a613cfa8bc5d0f36982128f6e233dce2404..4f6e0b9242abb2c091fcf04d819d778c6fbfd1cc 100644 (file)
@@ -5,11 +5,11 @@ linked 65536/65536 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 before sync:
 SCRATCH_MNT/file1
-0: [0..127]: 0x2001
+0: [0..127]: shared|last
 SCRATCH_MNT/file2
-0: [0..127]: 0x2001
+0: [0..127]: shared|last
 after sync:
 SCRATCH_MNT/file1
-0: [0..127]: 0x2001
+0: [0..127]: shared|last
 SCRATCH_MNT/file2
-0: [0..127]: 0x2001
+0: [0..127]: shared|last