summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/rc16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/rc b/common/rc
index 1618ded5..a438a8de 100644
--- a/common/rc
+++ b/common/rc
@@ -1180,6 +1180,15 @@ _repair_scratch_fs()
fi
return $res
;;
+ btrfs)
+ echo "yes|$BTRFS_UTIL_PROG check --repair --force $SCRATCH_DEV"
+ yes | $BTRFS_UTIL_PROG check --repair --force $SCRATCH_DEV 2>&1
+ local res=$?
+ if [ $res -ne 0 ]; then
+ _dump_err2 "btrfs repair failed, err=$res"
+ fi
+ return $res
+ ;;
bcachefs)
# With bcachefs, if fsck detects any errors we consider it a bug and we
# want the test to fail:
@@ -1232,6 +1241,13 @@ _repair_test_fs()
res=$?
fi
;;
+ btrfs)
+ echo 'yes|$BTRFS_UTIL_PROG check --repair --force "$TEST_DEV"' > \
+ /tmp.repair 2>&1
+ yes | $BTRFS_UTIL_PROG check --repair --force "$TEST_DEV" >> \
+ /tmp.repair 2>&1
+ res=$?
+ ;;
*)
# Let's hope fsck -y suffices...
fsck -t $FSTYP -y $TEST_DEV >$tmp.repair 2>&1