Skip to contentSkip to conversation

gfs2: allow testing with gfs2

PATCH New Jeff Layton 2 participants 2 messages Jul 26, 2017 – Jul 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: allow testing with gfs2

From: Jeff Layton <[email protected]>

For now, just have it avoid locking. With a fixed kernel, generic/441 now passes.

---
 common/config     | 1 +
 common/rc         | 7 +++++++
 tests/generic/441 | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)
common/config +1 -0
index 5091db9d5099..eb32efc105db 100644
@@ -244,6 +244,7 @@ case "$HOSTOS" in
         export MKFS_REISER4_PROG="`set_prog_path mkfs.reiser4`"
 	export E2FSCK_PROG="`set_prog_path e2fsck`"
 	export TUNE2FS_PROG="`set_prog_path tune2fs`"
+        export MKFS_GFS2_PROG="`set_prog_path mkfs.gfs2`"
         ;;
 esac
 
common/rc +7 -0
index bd989bb5f4dd..70bb39225368 100644
@@ -158,6 +158,9 @@ case "$FSTYP" in
     ext4)
 	 [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found"
 	 ;;
+    gfs2)
+	 [ "$MKFS_GFS2_PROG" = "" ] && _fatal "mkfs.gfs2 not found"
+	 ;;
     f2fs)
 	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
 	 ;;
@@ -861,6 +864,10 @@ _scratch_mkfs()
 		mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
 		mkfs_filter="grep -v -e ^mkfs\.ocfs2"
 		;;
+	gfs2)
+		mkfs_cmd="$MKFS_GFS2_PROG -p lock_nolock -O"
+		mkfs_filter="cat"
+		;;
 	*)
 		mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
 		mkfs_filter="cat"
tests/generic/441 +1 -1
index 075d87723ca1..b98f709cb6eb 100755
@@ -55,7 +55,7 @@ case $FSTYP in
 	btrfs)
 		_notrun "btrfs has a specialized test for this"
 		;;
-	ext3|ext4|xfs)
+	ext3|ext4|gfs2|xfs)
 		# Do the more thorough test if we have a logdev
 		_has_logdev && sflag=''
 		;;
Signature · 1 line
2.13.3
#1 lore raw

PATCH 1/1 gfs2: allow testing with gfs2

Quoted 29 lines · Jeff Layton

From: Jeff Layton <[email protected]>

For now, just have it avoid locking. With a fixed kernel, generic/441 now passes.

---
 common/config     | 1 +
 common/rc         | 7 +++++++
 tests/generic/441 | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)
common/config +1 -0
index 5091db9d5099..eb32efc105db 100644
@@ -244,6 +244,7 @@ case "$HOSTOS" in
         export MKFS_REISER4_PROG="`set_prog_path mkfs.reiser4`"
 	export E2FSCK_PROG="`set_prog_path e2fsck`"
 	export TUNE2FS_PROG="`set_prog_path tune2fs`"
+        export MKFS_GFS2_PROG="`set_prog_path mkfs.gfs2`"
         ;;
 esac
 
common/rc +0 -0
index bd989bb5f4dd..70bb39225368 100644

common/rc case "$FSTYP" in · line 163

Quoted 6 lines
common/rc +3 -0
@@ -158,6 +158,9 @@ case "$FSTYP" in
     ext4)
 	 [ "$MKFS_EXT4_PROG" = "" ] && _fatal "mkfs.ext4 not found"
 	 ;;
+    gfs2)
+	 [ "$MKFS_GFS2_PROG" = "" ] && _fatal "mkfs.gfs2 not found"
+	 ;;

The above two changes seem fine.

common/rc _scratch_mkfs() · line 870

Quoted 11 lines
common/rc +4 -0
     f2fs)
 	 [ "$MKFS_F2FS_PROG" = "" ] && _fatal "mkfs.f2fs not found"
 	 ;;
@@ -861,6 +864,10 @@ _scratch_mkfs()
 		mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
 		mkfs_filter="grep -v -e ^mkfs\.ocfs2"
 		;;
+	gfs2)
+		mkfs_cmd="$MKFS_GFS2_PROG -p lock_nolock -O"
+		mkfs_filter="cat"
+		;;

This seems unnecessary, we already have gfs2 support and the "-p lock_nolock -O" part is already added to MKFS_OPTIONS in _mkfs_opts() in common/config (when MKFS_OPTIONS is empty).

generic/411 runs and fails (fails due to kernel bug, not test config issue) now on gfs2 even without this change.

tests/generic/441 case $FSTYP in · line 58

Quoted 13 lines
common/rc +0 -0
 	*)
 		mkfs_cmd="yes | $MKFS_PROG -t $FSTYP --"
 		mkfs_filter="cat"
tests/generic/441 +1 -1
index 075d87723ca1..b98f709cb6eb 100755
@@ -55,7 +55,7 @@ case $FSTYP in
 	btrfs)
 		_notrun "btrfs has a specialized test for this"
 		;;
-	ext3|ext4|xfs)
+	ext3|ext4|gfs2|xfs)

Without external log device support in _scratch_mkfs for gfs2, this doesn't seem right to me. Perhaps we should add external log support for gfs2 then update this test, in different patches?

Thanks,
Eryu

Quoted 6 lines
tests/generic/441 +0 -0
 		# Do the more thorough test if we have a logdev
 		_has_logdev && sflag=''
 		;;
Signature · 1 line
2.13.3