Skip to contentSkip to conversation

xfstests: f2fs support

PATCH In review [email protected] 4 participants 6 messages Jun 2, 2014 – Dec 22, 2014 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: f2fs support

From: Jaegeuk Kim <[email protected]>

This patch adds to support f2fs file system.

---
 common/config | 7 +++++++
 common/rc     | 6 ++++++
 2 files changed, 13 insertions(+)
common/config +7 -0
index 0dbf0b9..0607294 100644
@@ -210,6 +210,7 @@ case "$HOSTOS" in
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
+        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
         export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
         export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
@@ -241,6 +242,9 @@ _mount_opts()
 		# acls & xattrs aren't turned on by default on ext$FOO
 		export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
 		;;
+	f2fs)
+		export MOUNT_OPTIONS="-o acl,user_xattr $F2FS_MOUNT_OPTIONS"
+		;;
 	reiserfs)
 		# acls & xattrs aren't turned on by default on reiserfs
 		export MOUNT_OPTIONS="-o acl,user_xattr $REISERFS_MOUNT_OPTIONS"
@@ -295,6 +299,9 @@ _fsck_opts()
 	reiserfs)
 		export FSCK_OPTIONS="--yes"
 		;;
+	f2fs)
+		export FSCK_OPTIONS=""
+		;;
 	*)
 		export FSCK_OPTIONS="-n"
 		;;
common/rc +6 -0
index f27ee53..fcdabfe 100644
@@ -105,6 +105,9 @@ case "$FSTYP" in
     btrfs)
 	 [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
 	 ;;
+    f2fs)
+	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+	 ;;
     nfs)
 	 ;;
 esac
@@ -511,6 +514,9 @@ _scratch_mkfs()
     tmpfs)
 	# do nothing for tmpfs
 	;;
+    f2fs)
+        $MKFS_F2FS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;
Signature · 6 lines
1.8.5.2 (Apple Git-48)

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 11 lines · On Mon, 2 Jun 2014, [email protected] wrote:

Date: Mon, 2 Jun 2014 22:59:32 +0900
From: [email protected]
To: Dave Chinner <[email protected]>
Cc: [email protected], [email protected],
[email protected], [email protected], Jaegeuk Kim <[email protected]>
Subject: [PATCH] xfstests: f2fs support

From: Jaegeuk Kim <[email protected]>

This patch adds to support f2fs file system.

Hi,

Looks good.

Btw dry run option in fsck is quite useful here because when the file system gets corrupted you do not want it to get fixed, but rather investigate the corrupted file system to figure out what happened. But of course it's not required :)

However after a quick look at you fsck code it seems that you do not attempt to fix anything at all...

Also having mkfs to check for existing signatures on the device before attempting to create the file system is a good thing to do (at least xfs, btrfs extN are doing so) to avoid data loss by mistake. You can use libblkid from util-linux and it's very simple to use.

Thanks!
-Lukas

Quoted 55 lines
---
 common/config | 7 +++++++
 common/rc     | 6 ++++++
 2 files changed, 13 insertions(+)
common/config +7 -0
index 0dbf0b9..0607294 100644
@@ -210,6 +210,7 @@ case "$HOSTOS" in
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
+        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
         export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
         export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
@@ -241,6 +242,9 @@ _mount_opts()
 		# acls & xattrs aren't turned on by default on ext$FOO
 		export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
 		;;
+	f2fs)
+		export MOUNT_OPTIONS="-o acl,user_xattr $F2FS_MOUNT_OPTIONS"
+		;;
 	reiserfs)
 		# acls & xattrs aren't turned on by default on reiserfs
 		export MOUNT_OPTIONS="-o acl,user_xattr $REISERFS_MOUNT_OPTIONS"
@@ -295,6 +299,9 @@ _fsck_opts()
 	reiserfs)
 		export FSCK_OPTIONS="--yes"
 		;;
+	f2fs)
+		export FSCK_OPTIONS=""
+		;;
 	*)
 		export FSCK_OPTIONS="-n"
 		;;
common/rc +3 -0
index f27ee53..fcdabfe 100644
@@ -105,6 +105,9 @@ case "$FSTYP" in
     btrfs)
 	 [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
 	 ;;
+    f2fs)
+	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+	 ;;
     nfs)
 	 ;;
 esac

common/rc _scratch_mkfs() · line 522

Quoted 9 lines
common/rc +3 -0
@@ -511,6 +514,9 @@ _scratch_mkfs()
     tmpfs)
 	# do nothing for tmpfs
 	;;
+    f2fs)
+        $MKFS_F2FS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by
#2 lore raw
Quoted 20 lines · Lukáš Czerner

Date: Tue, 3 Jun 2014 13:32:30 +0200 (CEST)
From: Lukáš Czerner <[email protected]>
To: Jaegeuk Kim <[email protected]>
Cc: Dave Chinner <[email protected]>, [email protected],
[email protected], [email protected], [email protected]
Subject: Re: [PATCH] xfstests: f2fs support

Quoted 10 lines · On Mon, 2 Jun 2014, [email protected] wrote:

Date: Mon, 2 Jun 2014 22:59:32 +0900
From: [email protected]
To: Dave Chinner <[email protected]>
Cc: [email protected], [email protected],
[email protected], [email protected], Jaegeuk Kim <[email protected]>
Subject: [PATCH] xfstests: f2fs support

From: Jaegeuk Kim <[email protected]>

Quoted 8 lines
Quoted 1 line

This patch adds to support f2fs file system.

Hi,

Looks good.

Oops, wrong macro. I meant to say

Quoted 77 lines

Btw dry run option in fsck is quite useful here because when the file system gets corrupted you do not want it to get fixed, but rather investigate the corrupted file system to figure out what happened. But of course it's not required :)

However after a quick look at you fsck code it seems that you do not attempt to fix anything at all...

Also having mkfs to check for existing signatures on the device before attempting to create the file system is a good thing to do (at least xfs, btrfs extN are doing so) to avoid data loss by mistake. You can use libblkid from util-linux and it's very simple to use.

Thanks!
-Lukas

Quoted 60 lines
---
 common/config | 7 +++++++
 common/rc     | 6 ++++++
 2 files changed, 13 insertions(+)
common/config +7 -0
index 0dbf0b9..0607294 100644
@@ -210,6 +210,7 @@ case "$HOSTOS" in
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
+        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
         export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
         export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
@@ -241,6 +242,9 @@ _mount_opts()
 		# acls & xattrs aren't turned on by default on ext$FOO
 		export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
 		;;
+	f2fs)
+		export MOUNT_OPTIONS="-o acl,user_xattr $F2FS_MOUNT_OPTIONS"
+		;;
 	reiserfs)
 		# acls & xattrs aren't turned on by default on reiserfs
 		export MOUNT_OPTIONS="-o acl,user_xattr $REISERFS_MOUNT_OPTIONS"
@@ -295,6 +299,9 @@ _fsck_opts()
 	reiserfs)
 		export FSCK_OPTIONS="--yes"
 		;;
+	f2fs)
+		export FSCK_OPTIONS=""
+		;;
 	*)
 		export FSCK_OPTIONS="-n"
 		;;
common/rc +6 -0
index f27ee53..fcdabfe 100644
@@ -105,6 +105,9 @@ case "$FSTYP" in
     btrfs)
 	 [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
 	 ;;
+    f2fs)
+	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+	 ;;
     nfs)
 	 ;;
 esac
@@ -511,6 +514,9 @@ _scratch_mkfs()
     tmpfs)
 	# do nothing for tmpfs
 	;;
+    f2fs)
+        $MKFS_F2FS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
+	;;
Quoted 9 lines

common/rc _scratch_mkfs() · line 522

Quoted 4 lines
common/rc +0 -0
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
In reply to [email protected]

(redirecting to the new fstests list)

Dave, this got a review from Lukas, and seems fine. Can you pull it in?

Thanks,
-Eric

Quoted 67 lines · On 6/2/14 8:59 AM, [email protected] wrote:

From: Jaegeuk Kim <[email protected]>

This patch adds to support f2fs file system.

---
 common/config | 7 +++++++
 common/rc     | 6 ++++++
 2 files changed, 13 insertions(+)
common/config +7 -0
index 0dbf0b9..0607294 100644
@@ -210,6 +210,7 @@ case "$HOSTOS" in
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
+        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
         export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
         export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
@@ -241,6 +242,9 @@ _mount_opts()
 		# acls & xattrs aren't turned on by default on ext$FOO
 		export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
 		;;
+	f2fs)
+		export MOUNT_OPTIONS="-o acl,user_xattr $F2FS_MOUNT_OPTIONS"
+		;;
 	reiserfs)
 		# acls & xattrs aren't turned on by default on reiserfs
 		export MOUNT_OPTIONS="-o acl,user_xattr $REISERFS_MOUNT_OPTIONS"
@@ -295,6 +299,9 @@ _fsck_opts()
 	reiserfs)
 		export FSCK_OPTIONS="--yes"
 		;;
+	f2fs)
+		export FSCK_OPTIONS=""
+		;;
 	*)
 		export FSCK_OPTIONS="-n"
 		;;
common/rc +6 -0
index f27ee53..fcdabfe 100644
@@ -105,6 +105,9 @@ case "$FSTYP" in
     btrfs)
 	 [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
 	 ;;
+    f2fs)
+	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+	 ;;
     nfs)
 	 ;;
 esac
@@ -511,6 +514,9 @@ _scratch_mkfs()
     tmpfs)
 	# do nothing for tmpfs
 	;;
+    f2fs)
+        $MKFS_F2FS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;
#4 lore raw
Quoted 4 lines · Eric Sandeen

(redirecting to the new fstests list)

Dave, this got a review from Lukas, and seems fine. Can you pull it in?

Can it be reposted so I can pull it in directly? quoted patches aren't recognised by any tool...

Cheers,

Dave.

Quoted 74 lines

Thanks,
-Eric

Quoted 67 lines · On 6/2/14 8:59 AM, [email protected] wrote:

From: Jaegeuk Kim <[email protected]>

This patch adds to support f2fs file system.

---
 common/config | 7 +++++++
 common/rc     | 6 ++++++
 2 files changed, 13 insertions(+)
common/config +7 -0
index 0dbf0b9..0607294 100644
@@ -210,6 +210,7 @@ case "$HOSTOS" in
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
+        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
         export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
         export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
@@ -241,6 +242,9 @@ _mount_opts()
 		# acls & xattrs aren't turned on by default on ext$FOO
 		export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
 		;;
+	f2fs)
+		export MOUNT_OPTIONS="-o acl,user_xattr $F2FS_MOUNT_OPTIONS"
+		;;
 	reiserfs)
 		# acls & xattrs aren't turned on by default on reiserfs
 		export MOUNT_OPTIONS="-o acl,user_xattr $REISERFS_MOUNT_OPTIONS"
@@ -295,6 +299,9 @@ _fsck_opts()
 	reiserfs)
 		export FSCK_OPTIONS="--yes"
 		;;
+	f2fs)
+		export FSCK_OPTIONS=""
+		;;
 	*)
 		export FSCK_OPTIONS="-n"
 		;;
common/rc +6 -0
index f27ee53..fcdabfe 100644
@@ -105,6 +105,9 @@ case "$FSTYP" in
     btrfs)
 	 [ "$MKFS_BTRFS_PROG" = "" ] && _fatal "mkfs.btrfs not found"
 	 ;;
+    f2fs)
+	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+	 ;;
     nfs)
 	 ;;
 esac
@@ -511,6 +514,9 @@ _scratch_mkfs()
     tmpfs)
 	# do nothing for tmpfs
 	;;
+    f2fs)
+        $MKFS_F2FS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;
Signature · 2 lines
Dave Chinner
[email protected]
author Reviewed-by Lukas Czerner
#5 lore raw

Thanks Eric,
I totally forgot this patch to repost.

Dave,
Could you please apply this patch?

Thanks,

-- >8 --

Quoted 1 line

From 86eb93921e1ce28e965e3152ac7066b45bccb4eb Mon Sep 17 00:00:00 2001

From: Jaegeuk Kim <[email protected]>
Date: Mon, 2 Jun 2014 20:09:19 +0900
Subject: [PATCH] xfstests: f2fs support

This patch adds to support f2fs file system.

---
 common/config | 7 +++++++
 common/rc     | 6 ++++++
 2 files changed, 13 insertions(+)
common/config +7 -0
index e9971fd..06bdee2 100644
@@ -219,6 +219,7 @@ case "$HOSTOS" in
         export MKFS_EXT4_PROG="`set_prog_path mkfs.ext4`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
+        export MKFS_F2FS_PROG="`set_prog_path mkfs.f2fs`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
         export BTRFS_SHOW_SUPER_PROG="`set_prog_path btrfs-show-super`"
         export XFS_FSR_PROG="`set_prog_path xfs_fsr`"
@@ -254,6 +255,9 @@ _mount_opts()
 		# acls & xattrs aren't turned on by default on ext$FOO
 		export MOUNT_OPTIONS="-o acl,user_xattr $EXT_MOUNT_OPTIONS"
 		;;
+	f2fs)
+		export MOUNT_OPTIONS="-o acl,user_xattr $F2FS_MOUNT_OPTIONS"
+		;;
 	reiserfs)
 		# acls & xattrs aren't turned on by default on reiserfs
 		export MOUNT_OPTIONS="-o acl,user_xattr $REISERFS_MOUNT_OPTIONS"
@@ -322,6 +326,9 @@ _fsck_opts()
 	reiserfs)
 		export FSCK_OPTIONS="--yes"
 		;;
+	f2fs)
+		export FSCK_OPTIONS=""
+		;;
 	*)
 		export FSCK_OPTIONS="-n"
 		;;
common/rc +6 -0
index 82a91c2..a39885d 100644
@@ -108,6 +108,9 @@ case "$FSTYP" in
     ext4)
 	 [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found"
 	 ;;
+    f2fs)
+	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
+	 ;;
     nfs)
 	 ;;
     cifs)
@@ -598,6 +601,9 @@ _scratch_mkfs()
     tmpfs)
 	# do nothing for tmpfs
 	;;
+    f2fs)
+        $MKFS_F2FS_PROG $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;
Signature · 1 line
2.1.1