When we start a fuzz test, dump the metadata to stdout so that anyone
analyzing a failure can see what was in the (supposedly) good image, and
what it turns into after fuzzing.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
done | grep -E "${filter}" | __filter_unvalidated_xfs_db_fields
}
+# Dump the current contents of a metadata object.
+# All arguments are xfs_db commands to locate the metadata.
+_scratch_xfs_dump_metadata() {
+ local cmds=()
+ for arg in "$@"; do
+ cmds+=("-c" "${arg}")
+ done
+ _scratch_xfs_db "${cmds[@]}" -c print
+}
+
# Navigate to some part of the filesystem and print the field info.
# The first argument is an grep filter for the fields
# The rest of the arguments are xfs_db commands to locate the metadata.
echo $(echo "${fields}")
echo "Verbs we propose to fuzz with:"
echo $(echo "${verbs}")
+ echo "Current metadata object state:"
+ _scratch_xfs_dump_metadata "$@"
# Always capture full core dumps from crashing tools
ulimit -c unlimited