]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/rc: use -f for mkfs.f2fs by default
authorChao Yu <chao@kernel.org>
Tue, 25 Mar 2025 12:58:22 +0000 (20:58 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 28 Mar 2025 01:05:05 +0000 (09:05 +0800)
Otherwise, mkfs will fail due to there is an existing filesystem
in the image.

Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc

index fa0f02ac44db93f2e20e919975dbe0e5d0c30f08..e954e7fd2df218b1b2b90db2ffada74e76775928 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -989,7 +989,7 @@ _scratch_mkfs()
                mkfs_filter="grep -v -e ^Warning: -e \"^mke2fs \""
                ;;
        f2fs)
-               mkfs_cmd="$MKFS_F2FS_PROG"
+               mkfs_cmd="$MKFS_F2FS_PROG -f"
                mkfs_filter="cat"
                ;;
        ocfs2)
@@ -1332,7 +1332,7 @@ _try_scratch_mkfs_sized()
        f2fs)
                # mkfs.f2fs requires # of sectors as an input for the size
                local sector_size=`blockdev --getss $SCRATCH_DEV`
-               $MKFS_F2FS_PROG $MKFS_OPTIONS "$@" $SCRATCH_DEV `expr $fssize / $sector_size`
+               $MKFS_F2FS_PROG -f $MKFS_OPTIONS "$@" $SCRATCH_DEV `expr $fssize / $sector_size`
                ;;
        tmpfs)
                local free_mem=`_free_memory_bytes`