Pass the -f option to mkfs.f2fs when it appears to support it.  This is
required by f2fs-tools v1.9 and later in order to format the filesystem
even when an existing filesystem is detected.  But earlier versions did
not accept this option.

Signed-off-by: Eric Biggers <ebigg...@google.com>
---
 kvm-xfstests/test-appliance/files/root/fs/f2fs/config | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kvm-xfstests/test-appliance/files/root/fs/f2fs/config 
b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config
index 45fb2dd..0efcb76 100644
--- a/kvm-xfstests/test-appliance/files/root/fs/f2fs/config
+++ b/kvm-xfstests/test-appliance/files/root/fs/f2fs/config
@@ -20,6 +20,10 @@ function format_filesystem()
     local dev="$1"
     local opts="$2"
 
+    if grep -q 'force overwrite' /sbin/mkfs.f2fs; then
+       # f2fs-tools v1.9+
+       opts+=" -f"
+    fi
     /sbin/mkfs.f2fs -q $opts "$dev"
     return $?
 }
-- 
2.17.0.484.g0c8726318c-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to