Skip to contentSkip to conversation

xfstests-bld: add f2fs support

PATCH Applied Eric Biggers 3 participants 8 messages Nov 17, 2016 – Dec 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests-bld: add f2fs support

Add basic f2fs support to xfstests-bld. I am using this to verify that the encryption tests I am adding to xfstests pass on both ext4 and f2fs. It may be useful to f2fs developers too. For now, only one configuration, "f2fs/default", is offered.

For the f2fs tests to work, it's required to build a kernel with f2fs support and build a rootfs with f2fs-tools installed. For testing encryption, f2fs-tools must be v1.5.0 or later.

It was necessary to remove the /etc/fstab lines for /dev/vd[b-f] because they interfered with non-ext4 fsck. They are not needed for the tests.

---
 kvm-xfstests/test-appliance/files/etc/fstab        |  5 --
 .../test-appliance/files/root/fs/f2fs/cfg/all.list |  1 +
 .../test-appliance/files/root/fs/f2fs/cfg/default  |  4 ++
 .../test-appliance/files/root/fs/f2fs/config       | 62 ++++++++++++++++++++++
 kvm-xfstests/util/parse_cli                        |  2 +-
 5 files changed, 68 insertions(+), 6 deletions(-)
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/config
kvm-xfstests/test-appliance/files/etc/fstab +0 -5
index 864478b..27fb1df 100644
@@ -5,9 +5,4 @@ proc            /proc           proc    defaults        0       0
 tmpfs		/tmp		tmpfs	mode=1777	0	0
 debugfs		/sys/kernel/debug debugfs defaults	0	0
 /dev/rootfs	/	ext4    noatime 0 1
-/dev/vdb	/vdb	ext4	defaults,noauto	0	0
-/dev/vdc	/vdc ext4	defaults,noauto	0	0
-/dev/vdd	/vdd ext4	defaults,noauto	0	0
-/dev/vde	/vde ext4	defaults,noauto 0	0
-/dev/vdf	/vdf ext4	defaults,noauto 0	0
 /dev/vdg	/results ext4	defaults 0 2
kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list new file +1 -0
new file mode 100644
index 0000000..4ad96d5
@@ -0,0 +1 @@
+default
kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default new file +4 -0
new file mode 100644
index 0000000..616a070
@@ -0,0 +1,4 @@
+SIZE=small
+export MKFS_OPTIONS=""
+export F2FS_MOUNT_OPTIONS=""
+TESTNAME="f2fs"
kvm-xfstests/test-appliance/files/root/fs/f2fs/config new file +62 -0

62 lines not on this page · raw message

kvm-xfstests/util/parse_cli +1 -1
index ea747be..b42c8ba 100644
@@ -59,7 +59,7 @@ print_help ()
 validate_test_name()
 {
     case "$1" in
-	btrfs*|cifs*|ext4*|generic*|shared*|udf*|xfs*|overlay*) ;;
+	btrfs*|cifs*|ext4*|f2fs*|generic*|shared*|udf*|xfs*|overlay*) ;;
 	*)
 	    echo -e "Invalid test name: $1\n"
 	    print_help
Signature · 1 line
2.8.0.rc3.226.g39d4020
#1 lore raw

Hi Eric,

Quoted 63 lines · Eric Biggers

Add basic f2fs support to xfstests-bld. I am using this to verify that the encryption tests I am adding to xfstests pass on both ext4 and f2fs. It may be useful to f2fs developers too. For now, only one configuration, "f2fs/default", is offered.

For the f2fs tests to work, it's required to build a kernel with f2fs support and build a rootfs with f2fs-tools installed. For testing encryption, f2fs-tools must be v1.5.0 or later.

It was necessary to remove the /etc/fstab lines for /dev/vd[b-f] because they interfered with non-ext4 fsck. They are not needed for the tests.

---
 kvm-xfstests/test-appliance/files/etc/fstab        |  5 --
 .../test-appliance/files/root/fs/f2fs/cfg/all.list |  1 +
 .../test-appliance/files/root/fs/f2fs/cfg/default  |  4 ++
 .../test-appliance/files/root/fs/f2fs/config       | 62 ++++++++++++++++++++++
 kvm-xfstests/util/parse_cli                        |  2 +-
 5 files changed, 68 insertions(+), 6 deletions(-)
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/f2fs/config
kvm-xfstests/test-appliance/files/etc/fstab +0 -5
index 864478b..27fb1df 100644
@@ -5,9 +5,4 @@ proc            /proc           proc    defaults        0       0
 tmpfs		/tmp		tmpfs	mode=1777	0	0
 debugfs		/sys/kernel/debug debugfs defaults	0	0
 /dev/rootfs	/	ext4    noatime 0 1
-/dev/vdb	/vdb	ext4	defaults,noauto	0	0
-/dev/vdc	/vdc ext4	defaults,noauto	0	0
-/dev/vdd	/vdd ext4	defaults,noauto	0	0
-/dev/vde	/vde ext4	defaults,noauto 0	0
-/dev/vdf	/vdf ext4	defaults,noauto 0	0
 /dev/vdg	/results ext4	defaults 0 2
kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/all.list new file +1 -0
new file mode 100644
index 0000000..4ad96d5
@@ -0,0 +1 @@
+default
kvm-xfstests/test-appliance/files/root/fs/f2fs/cfg/default new file +4 -0
new file mode 100644
index 0000000..616a070
@@ -0,0 +1,4 @@
+SIZE=small
+export MKFS_OPTIONS=""
+export F2FS_MOUNT_OPTIONS=""
+TESTNAME="f2fs"
kvm-xfstests/test-appliance/files/root/fs/f2fs/config new file +2 -0
new file mode 100644
index 0000000..3cab963
@@ -0,0 +1,62 @@
+#
+# Configuration file for f2fs

kvm-xfstests/test-appliance/files/root/fs/f2fs/config line 12

Quoted 10 lines
kvm-xfstests/test-appliance/files/root/fs/f2fs/config new file +10 -0
+#
+
+DEFAULT_MKFS_OPTIONS=""
+
+function check_filesystem()
+{
+    local dev="$1"
+    local ret
+
+    /sbin/fsck.f2fs -f "$dev"

Could you change to call fsck.f2fs instead of /sbin/xx?
I'm almost finished to import f2fs-tools in xfstests-bld for kvm-xfstests. Given f2fs-tools from git, it seems /sbin/xx doesn't work.

kvm-xfstests/test-appliance/files/root/fs/f2fs/config line 23

Quoted 11 lines
kvm-xfstests/test-appliance/files/root/fs/f2fs/config new file +11 -0
+    ret="$?"
+    echo fsck.f2fs exited with status "$ret"
+    return "$ret"
+}
+
+function format_filesystem()
+{
+    local dev="$1"
+    local opts="$2"
+
+    /sbin/mkfs.f2fs -q $opts "$dev"

Ditto, mkfs.f2fs.

Thanks,

Quoted 59 lines
kvm-xfstests/test-appliance/files/root/fs/f2fs/config new file +39 -0
+    return $?
+}
+
+function setup_mount_opts()
+{
+    if test -n "$MNTOPTS" ; then
+	if test -n "$F2FS_MOUNT_OPTIONS" ; then
+	    F2FS_MOUNT_OPTIONS="$F2FS_MOUNT_OPTIONS,$MNTOPTS"
+	else
+	    F2FS_MOUNT_OPTIONS="-o $MNTOPTS"
+	fi
+    fi
+}
+
+function get_mkfs_opts()
+{
+    echo "$MKFS_OPTIONS"
+}
+
+function show_mkfs_opts()
+{
+    echo MKFS_OPTIONS: "$MKFS_OPTIONS"
+}
+
+function show_mount_opts()
+{
+    echo F2FS_MOUNT_OPTIONS: "$F2FS_MOUNT_OPTIONS"
+}
+
+function test_name_alias()
+{
+    echo "$1"
+}
+
+function reset_vars()
+{
+    unset F2FS_MOUNT_OPTIONS
+    unset MKFS_OPTIONS
+}
kvm-xfstests/util/parse_cli +1 -1
index ea747be..b42c8ba 100644
@@ -59,7 +59,7 @@ print_help ()
 validate_test_name()
 {
     case "$1" in
-	btrfs*|cifs*|ext4*|generic*|shared*|udf*|xfs*|overlay*) ;;
+	btrfs*|cifs*|ext4*|f2fs*|generic*|shared*|udf*|xfs*|overlay*) ;;
 	*)
 	    echo -e "Invalid test name: $1\n"
 	    print_help
Signature · 6 lines
2.8.0.rc3.226.g39d4020

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 5 lines · Jaegeuk Kim
Quoted 1 line

+ /sbin/fsck.f2fs -f "$dev"

Could you change to call fsck.f2fs instead of /sbin/xx?
I'm almost finished to import f2fs-tools in xfstests-bld for kvm-xfstests. Given f2fs-tools from git, it seems /sbin/xx doesn't work.

So why won't /sbin/fsck.f2fs not work? The /sbin/fsck driver does assume that /sbin/fsck.<type> will work, and other file systems do have hard links or put their actual file system checker there:

% ls /sbin/fsck.*

36 /sbin/fsck.cramfs*  0 /sbin/fsck.ext3@     60 /sbin/fsck.fat*     4 /sbin/fsck.nfs*
0 /sbin/fsck.exfat@    0 /sbin/fsck.ext4@     76 /sbin/fsck.minix*   0 /sbin/fsck.vfat@
0 /sbin/fsck.ext2@     0 /sbin/fsck.ext4dev@   0 /sbin/fsck.msdos@   4 /sbin/fsck.xfs*
Quoted 3 lines
Quoted 1 line

+ /sbin/mkfs.f2fs -q $opts "$dev"

Ditto, mkfs.f2fs.

Ditto:

% ls /sbin/mkfs.*
28 /sbin/mkfs.bfs* 0 /sbin/mkfs.ext3@ 76 /sbin/mkfs.minix* 352 /sbin/mkfs.xfs*
36 /sbin/mkfs.cramfs* 0 /sbin/mkfs.ext4@ 0 /sbin/mkfs.msdos@
0 /sbin/mkfs.exfat@ 0 /sbin/mkfs.ext4dev@ 0 /sbin/mkfs.ntfs@
0 /sbin/mkfs.ext2@ 36 /sbin/mkfs.fat* 0 /sbin/mkfs.vfat@

- Ted

#3 lore raw
Quoted 7 lines · Theodore Ts'o
Quoted 5 lines · Jaegeuk Kim
Quoted 1 line

+ /sbin/fsck.f2fs -f "$dev"

Could you change to call fsck.f2fs instead of /sbin/xx?
I'm almost finished to import f2fs-tools in xfstests-bld for kvm-xfstests. Given f2fs-tools from git, it seems /sbin/xx doesn't work.

Quoted 9 lines

So why won't /sbin/fsck.f2fs not work? The /sbin/fsck driver does assume that /sbin/fsck.<type> will work, and other file systems do have hard links or put their actual file system checker there:

% ls /sbin/fsck.*

36 /sbin/fsck.cramfs*  0 /sbin/fsck.ext3@     60 /sbin/fsck.fat*     4 /sbin/fsck.nfs*
0 /sbin/fsck.exfat@    0 /sbin/fsck.ext4@     76 /sbin/fsck.minix*   0 /sbin/fsck.vfat@
0 /sbin/fsck.ext2@     0 /sbin/fsck.ext4dev@   0 /sbin/fsck.msdos@   4 /sbin/fsck.xfs*

IIUC, I guess it'd be okay if VM installed that as a package. I tried to add f2fs-tools repo likewise fio, I could't find /sbin/mkfs.f2fs, even if it was installed into bld/sbin/. Instead, bld/sbin/* were copied into xfstests/bin/ in VM, which enables to execute mkfs.f2fs globally through $PATH.

I set up an almost default kvm-xfstests, and I could see:

# ls /sbin/mkfs*
/sbin/mkfs	/sbin/mkfs.cramfs  /sbin/mkfs.ext3  /sbin/mkfs.ext4dev
/sbin/mkfs.bfs	/sbin/mkfs.ext2    /sbin/mkfs.ext4  /sbin/mkfs.minix
# ls /root/xfstests/bin/mkfs.*
/root/xfstests/bin/mkfs.f2fs  /root/xfstests/bin/mkfs.xfs

Let me know, if I'm missing something.

Thanks,

Quoted 14 lines
Quoted 4 lines
Quoted 2 lines

+ /sbin/mkfs.f2fs -q $opts "$dev"

Ditto, mkfs.f2fs.

Ditto:

% ls /sbin/mkfs.*
28 /sbin/mkfs.bfs* 0 /sbin/mkfs.ext3@ 76 /sbin/mkfs.minix* 352 /sbin/mkfs.xfs*
36 /sbin/mkfs.cramfs* 0 /sbin/mkfs.ext4@ 0 /sbin/mkfs.msdos@
0 /sbin/mkfs.exfat@ 0 /sbin/mkfs.ext4dev@ 0 /sbin/mkfs.ntfs@
0 /sbin/mkfs.ext2@ 36 /sbin/mkfs.fat* 0 /sbin/mkfs.vfat@

- Ted

#4 lore raw
Quoted 5 lines · Jaegeuk Kim

IIUC, I guess it'd be okay if VM installed that as a package. I tried to add f2fs-tools repo likewise fio, I could't find /sbin/mkfs.f2fs, even if it was installed into bld/sbin/. Instead, bld/sbin/* were copied into xfstests/bin/ in VM, which enables to execute mkfs.f2fs globally through $PATH.

Ah, I see what you mean; I thought you were talking about your local f2fstools git repo, and not changes you've made to your local xfstests-bld repo.

The reason why xfsprogs is installed in xfstests/bin is that historically, xfstests needed some of the xfsprogs tools (no matter what file system type you were testing), and the xfsprogs installed in Debian and Ubuntu was too old or didn't install all of the utilities that xfstests required.

However, I have not tried to build the file system utilities for other file systems in xfstests-bld --- and this includes e2fsprogs. My goal is to allow xfstests-bld to support a large number of file systems, and it doesn't scale to build all file system utilities in xfstests-bld. Also, most of the time, the file system utilities tend to move at a slower pace, and the requirements for needing a newer file system utility than what is shipped in the distribution is rarer.

I have sometimes built a newer version of e2fsprogs as a Debian package, and installed it into the VM. These days, what I tend to do when that's been necessary is to build a new Debian package for jessie-backports, and upload it to the jessie-backports repository, so everyone can use the same binary package.

I guess I don't have any objections to allowing people to put locally compiled versions of the utilities in /root/xfstests/sbin and rely on the PATH to use that version in preference to the /sbin/mkfs.f2fs version of the utilities. As far as adding the ability to download and build local versions of f2fstools in the upstream xfstests-bld, I guess I could accept that so long as it's optional, and not turned on by default. The main issue here is that if i have a half dozen file system-specific utilities included in xfstests-bld, which were all enabled for download by default, it would increase the build time of xfstests-bld significantly, so it doesn't scale. I'd much prefer to see newer versions of the utilities (if necessary) in debian-backports.

Cheers,

- Ted

#5 lore raw
Quoted 31 lines · Theodore Ts'o
Quoted 5 lines · Jaegeuk Kim

IIUC, I guess it'd be okay if VM installed that as a package. I tried to add f2fs-tools repo likewise fio, I could't find /sbin/mkfs.f2fs, even if it was installed into bld/sbin/. Instead, bld/sbin/* were copied into xfstests/bin/ in VM, which enables to execute mkfs.f2fs globally through $PATH.

Ah, I see what you mean; I thought you were talking about your local f2fstools git repo, and not changes you've made to your local xfstests-bld repo.

The reason why xfsprogs is installed in xfstests/bin is that historically, xfstests needed some of the xfsprogs tools (no matter what file system type you were testing), and the xfsprogs installed in Debian and Ubuntu was too old or didn't install all of the utilities that xfstests required.

However, I have not tried to build the file system utilities for other file systems in xfstests-bld --- and this includes e2fsprogs. My goal is to allow xfstests-bld to support a large number of file systems, and it doesn't scale to build all file system utilities in xfstests-bld. Also, most of the time, the file system utilities tend to move at a slower pace, and the requirements for needing a newer file system utility than what is shipped in the distribution is rarer.

I have sometimes built a newer version of e2fsprogs as a Debian package, and installed it into the VM. These days, what I tend to do when that's been necessary is to build a new Debian package for jessie-backports, and upload it to the jessie-backports repository, so everyone can use the same binary package.

Quoted 12 lines

I guess I don't have any objections to allowing people to put locally compiled versions of the utilities in /root/xfstests/sbin and rely on the PATH to use that version in preference to the /sbin/mkfs.f2fs version of the utilities. As far as adding the ability to download and build local versions of f2fstools in the upstream xfstests-bld, I guess I could accept that so long as it's optional, and not turned on by default. The main issue here is that if i have a half dozen file system-specific utilities included in xfstests-bld, which were all enabled for download by default, it would increase the build time of xfstests-bld significantly, so it doesn't scale. I'd much prefer to see newer versions of the utilities (if necessary) in debian-backports.

Agreed to all of them. What I tried to set up actually was to test the latest f2fs-tools in prior to release out. Anyway, I agree it'd be good to add an option to select local fs utilities through config.custom to avoid the scaling problem.

I realize that xfstests-bld is really great to test multiple kernel versions. I guess it can be quite doable to test arm-based kernel as well, as I can see cross compile environment.

Thank you for sharing this tool.

Quoted 4 lines

Cheers,

- Ted

#6 lore raw
Quoted 4 lines · Jaegeuk Kim

I realize that xfstests-bld is really great to test multiple kernel versions. I guess it can be quite doable to test arm-based kernel as well, as I can see cross compile environment.

I have had reports that some folks have run into problems using the armhf chroot on an Android device. I'm not sure what problems they ran into, since their report was quite vague. I'm aware of one namespace-related test that will fail when you run xfstests in a chroot, and I would expect that SELinux would have to be disabled, but other than that I would have expected it to work.

If you (or anyone else) have managed to use the armhf chroot successfully on an Android device, please let me know, and let me know if there are any updates we can make to Documentation/android-xfstests.md.

Unfortunately I haven't had time to investigate those reports myself. If someone has time to try it out and send me a more detailed report, that would be great.

Thanks!!

- Ted

#7 lore raw
In reply to Eric Biggers
Quoted 5 lines · Eric Biggers

Add basic f2fs support to xfstests-bld. I am using this to verify that the encryption tests I am adding to xfstests pass on both ext4 and f2fs. It may be useful to f2fs developers too. For now, only one configuration, "f2fs/default", is offered.

Quoted 8 lines

For the f2fs tests to work, it's required to build a kernel with f2fs support and build a rootfs with f2fs-tools installed. For testing encryption, f2fs-tools must be v1.5.0 or later.

It was necessary to remove the /etc/fstab lines for /dev/vd[b-f] because they interfered with non-ext4 fsck. They are not needed for the tests.

Thanks, applied.

- Ted