4 source "$TEST_TOP/common"
6 check_prereq mkfs.btrfs
15 $TOP/btrfs inspect-internal dump-super "$image" | \
16 grep '^log_root\>' | awk '{print $2}'
18 get_log_root_level() {
22 $TOP/btrfs inspect-internal dump-super "$image" | \
23 grep '^log_root_level' | awk '{print $2}'
28 # FIXME: we need an image with existing log_root
29 run_check $SUDO_HELPER $TOP/mkfs.btrfs -f \
30 --rootdir $INTERNAL_BIN/Documentation \
32 run_check $TOP/btrfs inspect-internal dump-super $TEST_DEV
33 if [ "$1" = 'standalone' ]; then
34 run_check $TOP/btrfs rescue zero-log $TEST_DEV
36 run_check $TOP/btrfs-zero-log $TEST_DEV
38 log_root=$(get_log_root $TEST_DEV)
39 log_root_level=$(get_log_root $TEST_DEV)
40 if [ "$log_root" != 0 ]; then
41 _fail "FAIL: log_root not reset"
43 if [ "$log_root_level" != 0 ]; then
44 _fail "FAIL: log_root_level not reset"
46 run_check $TOP/btrfs inspect-internal dump-super $TEST_DEV
47 run_check $SUDO_HELPER $TOP/btrfs check $TEST_DEV
50 test_zero_log standalone
51 test_zero_log internal