@@ -110,6 +110,16 @@ __filter_xfs_db_print_fields() {
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.
@@ -534,6 +544,8 @@ _scratch_xfs_fuzz_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