test-appliance: support f2fs-tools v1.9 and later
PATCH 1/1 test-appliance: support f2fs-tools v1.9 and later
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.
--- kvm-xfstests/test-appliance/files/root/fs/f2fs/config | 4 ++++ 1 file changed, 4 insertions(+)
kvm-xfstests/test-appliance/files/root/fs/f2fs/config +4 -0
@@ -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 $? }
Signature · 1 line
2.17.0.484.g0c8726318c-goog
Quoted 6 lines · Eric Biggers
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 <[email protected]>
Applied for now, but ugh. Grepping strings out of binaries is not something I really like to depend upon. Can we convince the f2fs folks to provide a "/sbin/mkfs.f2fs -V" which prints a version string, or some such?
- Ted
Quoted 6 lines · Theodore Y. Ts'o
Quoted 5 lines · Eric Biggers
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.
Quoted 7 lines
Quoted 1 line
Signed-off-by Eric Biggers <[email protected]>Applied for now, but ugh. Grepping strings out of binaries is not something I really like to depend upon. Can we convince the f2fs folks to provide a "
/sbin/mkfs.f2fs-V" which prints a version string, or some such?
Yes, it's ugly. As something maybe a bit better, I've proposed
mkfs.f2fs --help |& grep -q "[[:space:]]-f[[:space:]|]"
in v2 of the xfstests patch to common/config. So if that gets accepted into xfstests I'll change this to use the same method.
Thanks,
Eric