[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250620175324.tyx4s4dxdslv7hqx@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
Date: Sat, 21 Jun 2025 01:53:24 +0800
From: Zorro Lang <zlang@...hat.com>
To: Leah Rumancik <leah.rumancik@...il.com>
Cc: fstests@...r.kernel.org, linux-ext4@...r.kernel.org
Subject: Re: [PATCH] common/rc: add repair fsck flag -f for ext4
On Fri, May 30, 2025 at 12:27:11PM -0700, Leah Rumancik wrote:
> There is a descrepancy between the fsck flags for ext4 during
> filesystem repair and filesystem checking which causes occasional test
> failures. In particular, _check_generic_filesystems uses -f for force
> checking, but _repair_scratch_fs does not. In some tests, such as
> generic/441, we sometimes exit fsck repair early with the filesystem
> being deemed "clean" but then _check_generic_filesystems finds issues
> during the forced full check. Bringing these flags in sync fixes the
> flakes.
>
> Signed-off-by: Leah Rumancik <leah.rumancik@...il.com>
> ---
CC ext4 list to get more review points.
> common/rc | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index daf62c92..042f6c36 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1496,19 +1496,24 @@ _repair_scratch_fs()
> _check_scratch_fs
> ;;
> *)
> local dev=$SCRATCH_DEV
> local fstyp=$FSTYP
> + local fsopts=
> if [ $FSTYP = "overlay" -a -n "$OVL_BASE_SCRATCH_DEV" ]; then
> _repair_overlay_scratch_fs
> # Fall through to repair base fs
> dev=$OVL_BASE_SCRATCH_DEV
> fstyp=$OVL_BASE_FSTYP
> _unmount $OVL_BASE_SCRATCH_MNT
> fi
> + if [ $FSTYP = "ext4" ]; then
What if ext2 and ext3?
> + fsopts="-f"
> + fi
> +
> # Let's hope fsck -y suffices...
> - fsck -t $fstyp -y $dev 2>&1
> + fsck -t $fstyp -y ${fsopts} $dev 2>&1
> local res=$?
> case $res in
> $FSCK_OK|$FSCK_NONDESTRUCT|$FSCK_REBOOT)
> res=0
> ;;
> @@ -1548,12 +1553,16 @@ _repair_test_fs()
> yes | $BTRFS_UTIL_PROG check --repair --force "$TEST_DEV" >> \
> $tmp.repair 2>&1
> res=$?
> ;;
> *)
> + local fsopts=
> + if [ $FSTYP = "ext4" ]; then
> + fsopts="-f"
> + fi
> # Let's hope fsck -y suffices...
> - fsck -t $FSTYP -y $TEST_DEV >$tmp.repair 2>&1
> + fsck -t $FSTYP -y ${fsopts} $TEST_DEV >$tmp.repair 2>&1
> res=$?
> if test "$res" -lt 4 ; then
> res=0
> fi
> ;;
> --
> 2.49.0.1204.g71687c7c1d-goog
>
>
Powered by blists - more mailing lists