#! /bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2022-2025 Oracle.  All Rights Reserved.
#
# FS QA Test No. 813
#
# Populate a XFS filesystem and fuzz every metadir subdir field.
# Do not fix the filesystem, to test metadata verifiers.

. ./common/preamble
_begin_fstest dangerous_fuzzers fuzzers_norepair realtime

_register_cleanup "_cleanup" BUS

. ./common/filter
. ./common/populate
. ./common/fuzzy

_require_xfs_scratch_metadir
_require_scratch_xfs_fuzz_fields
_disable_dmesg_check

echo "Format and populate"
_scratch_populate_cached nofill > $seqres.full 2>&1

inode_ver=$(_scratch_xfs_get_metadata_field "core.version" 'path -m /rtgroups')

echo "Fuzz metadir subdir"
_scratch_xfs_fuzz_metadata '' 'none' 'path -m /rtgroups' >> $seqres.full
echo "Done fuzzing metadir subdir"

# success, all done
status=0
exit
