Skip to contentSkip to conversation

btrfs/010: don't run without /sys/fs/btrfs

PATCH In review [email protected] 3 participants 18 messages Jan 21, 2019 – Jan 23, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 btrfs/010: don't run without /sys/fs/btrfs

From: Jeff Mahoney <[email protected]>

Older kernels don't have /sys/fs/btrfs. btrfs/010 will happily run until it goes to check its work against sysfs and finds those files don't exist. This patch introduces a require check to ensure that the sysfs files are present before running.

---
 common/btrfs    | 8 ++++++++
 tests/btrfs/010 | 1 +
 2 files changed, 9 insertions(+)
common/btrfs +8 -0
index 26dc0bb9..f6513c06 100644
@@ -89,6 +89,14 @@ _require_btrfs_fs_feature()
 		_notrun "Feature $feat not supported by the available btrfs version"
 }
 
+_require_btrfs_fs_sysfs()
+{
+	modprobe btrfs > /dev/null 2>&1
+	[ -e /sys/fs/btrfs/features ] || \
+		_notrun "Sysfs not supported by the available btrfs version"
+
+}
+
 _check_btrfs_filesystem()
 {
 	device=$1
tests/btrfs/010 +1 -0
index 1a5f0146..72b2c727 100755
@@ -33,6 +33,7 @@ rm -f $seqres.full
 _supported_fs btrfs
 _supported_os Linux
 _require_test
+_require_btrfs_fs_sysfs
 
 # Create 32k extents. All of these extents will be accounted as outstanding and
 # reserved.
Signature · 1 line
2.16.4
#1 lore raw

PATCH 2/7 filter: fix assumed whitespace in _filefrag_filter regex

From: Jeff Mahoney <[email protected]>

The regex assumes there will be whitespace after the .. in the ranges and, with larger offsets, there may not be any.

---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/filter +1 -1
index ed082d24..b4443a34 100644
@@ -532,7 +532,7 @@ _filter_filefrag()
 		next
 	}
 	($ext, $logical, $physical, $length) =
-		(/^\s*(\d+):\s+(\d+)..\s+\d+:\s+(\d+)..\s+\d+:\s+(\d+):/)
+		(/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/)
 	or next;
 	($flags) = /.*:\s*(\S*)$/;
 	print $physical * $blocksize, "#",
Signature · 1 line
2.16.4
#2 lore raw

Re: [PATCH 2/7] filter: fix assumed whitespace in _filefrag_filter regex

Quoted 4 lines · On Mon, Jan 21, 2019 at 11:33:11AM -0500, [email protected] wrote:

From: Jeff Mahoney <[email protected]>

The regex assumes there will be whitespace after the .. in the ranges and, with larger offsets, there may not be any.

Does more than this, right?

Quoted 10 lines
---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/filter +0 -0
index ed082d24..b4443a34 100644

common/filter _filter_filefrag() · line 535

Quoted 5 lines
common/filter +1 -1
@@ -532,7 +532,7 @@ _filter_filefrag()
 		next
 	}
 	($ext, $logical, $physical, $length) =
-		(/^\s*(\d+):\s+(\d+)..\s+\d+:\s+(\d+)..\s+\d+:\s+(\d+):/)
+		(/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/)

This is escaping "..", too, isn't it?

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#3 lore raw

Re: [PATCH 2/7] filter: fix assumed whitespace in _filefrag_filter regex

Quoted 7 lines · Dave Chinner
Quoted 4 lines · On Mon, Jan 21, 2019 at 11:33:11AM -0500, [email protected] wrote:

From: Jeff Mahoney <[email protected]>

The regex assumes there will be whitespace after the .. in the ranges and, with larger offsets, there may not be any.

Does more than this, right?

I suppose. It converts the interpreted .. into a literal .., which I believe was the original intent.

Quoted 5 lines
Quoted 5 lines
---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

common/filter _filter_filefrag() · line 535

Quoted 10 lines
common/filter +1 -1
index ed082d24..b4443a34 100644
@@ -532,7 +532,7 @@ _filter_filefrag()
 		next
 	}
 	($ext, $logical, $physical, $length) =
-		(/^\s*(\d+):\s+(\d+)..\s+\d+:\s+(\d+)..\s+\d+:\s+(\d+):/)
+		(/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/)

This is escaping "..", too, isn't it?

Yes, but what else could the .. in the original regex have been referring to? I don't recall seeing any other filefrag format that would match otherwise.

I don't have a problem documenting it further, though.

-Jeff

Signature · 2 lines
Jeff Mahoney
SUSE Labs
#4 lore raw

Re: [PATCH 2/7] filter: fix assumed whitespace in _filefrag_filter regex

Quoted 30 lines · Jeff Mahoney
Quoted 7 lines · Dave Chinner
Quoted 4 lines · On Mon, Jan 21, 2019 at 11:33:11AM -0500, [email protected] wrote:

From: Jeff Mahoney <[email protected]>

The regex assumes there will be whitespace after the .. in the ranges and, with larger offsets, there may not be any.

Does more than this, right?

I suppose. It converts the interpreted .. into a literal .., which I believe was the original intent.

Quoted 5 lines
Quoted 5 lines
---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

common/filter _filter_filefrag() · line 535

Quoted 10 lines
common/filter +1 -1
index ed082d24..b4443a34 100644
@@ -532,7 +532,7 @@ _filter_filefrag()
 		next
 	}
 	($ext, $logical, $physical, $length) =
-		(/^\s*(\d+):\s+(\d+)..\s+\d+:\s+(\d+)..\s+\d+:\s+(\d+):/)
+		(/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/)

This is escaping "..", too, isn't it?

Quoted 3 lines

Yes, but what else could the .. in the original regex have been referring to? I don't recall seeing any other filefrag format that would match otherwise.

Neither do I. My point was it was a change that was not documented in the commit message and so there might be something I was missing.

Quoted 1 line

I don't have a problem documenting it further, though.

That'd be great, thanks!

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#5 lore raw

PATCH 3/7 filter: add support for old filefrag -v

In reply to [email protected]

From: Jeff Mahoney <[email protected]>

e2fsprogs versions prior to v1.42.7 had a different format for filefrag -v that is incompatible with the regex in _filefrag_filter.

This patch adds support for the older format to test on older releases

---
 common/filter | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
common/filter +19 -5
index b4443a34..a8ddf571 100644
@@ -528,13 +528,27 @@ _filter_filefrag()
 {
 	perl -ne '
 	if (/blocks? of (\d+) bytes/) {
+		$oldfmt = 0;
 		$blocksize = $1;
-		next
+		next;
+	} elsif (/\d+ blocks, blocksize (\d+)/) {
+		$oldfmt = 1;
+		$blocksize = $1;
+		next;
+	}
+	if ($oldfmt) {
+		chomp;
+		($ext, $logical, $physical, $ignore, $length1, $length2, $flags) =
+			(/^\s*(\d+)\s+(\d+)\s+(\d+)\s+((\d+)|\d+\s+(\d+))\s+([a-z0-9,]*)$/)
+		or next;
+		$length = "$length1$length2";
+	} else {
+		($ext, $logical, $physical, $length) =
+			(/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/)
+		or next;
+		($flags) = /.*:\s*(\S*)$/;
 	}
-	($ext, $logical, $physical, $length) =
-		(/^\s*(\d+):\s+(\d+)\.\.\s*\d+:\s+(\d+)\.\.\s*\d+:\s+(\d+):/)
-	or next;
-	($flags) = /.*:\s*(\S*)$/;
+
 	print $physical * $blocksize, "#",
 	      $length * $blocksize, "#",
 	      $logical * $blocksize, "#",
Signature · 1 line
2.16.4
#6 lore raw

Re: [PATCH 3/7] filter: add support for old filefrag -v

Quoted 6 lines · On Mon, Jan 21, 2019 at 11:33:12AM -0500, [email protected] wrote:

From: Jeff Mahoney <[email protected]>

e2fsprogs versions prior to v1.42.7 had a different format for filefrag -v that is incompatible with the regex in _filefrag_filter.

This patch adds support for the older format to test on older releases

Can you document what the two formats are in a comment just so it is somewhat easier to check the regexes are, indeed, doing the right thing?

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#7 lore raw

Re: [PATCH 3/7] filter: add support for old filefrag -v

Quoted 11 lines · Dave Chinner
Quoted 6 lines · On Mon, Jan 21, 2019 at 11:33:12AM -0500, [email protected] wrote:

From: Jeff Mahoney <[email protected]>

e2fsprogs versions prior to v1.42.7 had a different format for filefrag -v that is incompatible with the regex in _filefrag_filter.

This patch adds support for the older format to test on older releases

Can you document what the two formats are in a comment just so it is somewhat easier to check the regexes are, indeed, doing the right thing?

Sure. That's easy enough.

-Jeff

Signature · 2 lines
Jeff Mahoney
SUSE Labs
#8 lore raw

PATCH 4/7 btrfs: require feature raid56 for raid56 tests

In reply to [email protected]

From: Jeff Mahoney <[email protected]>

btrfs/125, btrfs/148, btrfs/157, and btrfs/158 test for raid56 behavior. We shouldn't run if the kernel doesn't have support for them.

---
 tests/btrfs/125 | 1 +
 tests/btrfs/148 | 1 +
 tests/btrfs/157 | 1 +
 tests/btrfs/158 | 1 +
 4 files changed, 4 insertions(+)
tests/btrfs/125 +1 -0
index 5ac68b67..847fa62a 100755
@@ -51,6 +51,7 @@ _supported_os Linux
 _require_scratch_dev_pool 3
 _test_unmount
 _require_loadable_fs_module "btrfs"
+_require_btrfs_fs_feature raid56
 
 _scratch_dev_pool_get 3
 
tests/btrfs/148 +1 -0
index d0e554c2..3fd8616f 100755
@@ -30,6 +30,7 @@ _supported_os Linux
 _require_scratch
 _require_scratch_dev_pool 4
 _require_odirect
+_require_btrfs_fs_feature raid56
 
 _scratch_dev_pool_get 4
 
tests/btrfs/157 +1 -0
index d9ea4b7b..7f75c407 100755
@@ -49,6 +49,7 @@ _supported_fs btrfs
 _supported_os Linux
 _require_scratch_dev_pool 4
 _require_btrfs_command inspect-internal dump-tree
+_require_btrfs_fs_feature raid56
 
 get_physical_stripe0()
 {
tests/btrfs/158 +1 -0
index fe2dd956..603e8bea 100755
@@ -41,6 +41,7 @@ _supported_fs btrfs
 _supported_os Linux
 _require_scratch_dev_pool 4
 _require_btrfs_command inspect-internal dump-tree
+_require_btrfs_fs_feature raid56
 
 get_physical_stripe0()
 {
Signature · 1 line
2.16.4
Reviewed-by on v1 4/7
#9 lore raw

Re: [PATCH 4/7] btrfs: require feature raid56 for raid56 tests

Quoted 7 lines · On Mon, Jan 21, 2019 at 4:33 PM <[email protected]> wrote:

From: Jeff Mahoney <[email protected]>

btrfs/125, btrfs/148, btrfs/157, and btrfs/158 test for raid56 behavior. We shouldn't run if the kernel doesn't have support for them.

Looks good. Since it's a btrfs specific change/fix, it would have been a good idea to cc linux-btrfs.

Quoted 58 lines
---
 tests/btrfs/125 | 1 +
 tests/btrfs/148 | 1 +
 tests/btrfs/157 | 1 +
 tests/btrfs/158 | 1 +
 4 files changed, 4 insertions(+)
tests/btrfs/125 +1 -0
index 5ac68b67..847fa62a 100755
@@ -51,6 +51,7 @@ _supported_os Linux
 _require_scratch_dev_pool 3
 _test_unmount
 _require_loadable_fs_module "btrfs"
+_require_btrfs_fs_feature raid56
 
 _scratch_dev_pool_get 3
 
tests/btrfs/148 +1 -0
index d0e554c2..3fd8616f 100755
@@ -30,6 +30,7 @@ _supported_os Linux
 _require_scratch
 _require_scratch_dev_pool 4
 _require_odirect
+_require_btrfs_fs_feature raid56
 
 _scratch_dev_pool_get 4
 
tests/btrfs/157 +1 -0
index d9ea4b7b..7f75c407 100755
@@ -49,6 +49,7 @@ _supported_fs btrfs
 _supported_os Linux
 _require_scratch_dev_pool 4
 _require_btrfs_command inspect-internal dump-tree
+_require_btrfs_fs_feature raid56
 
 get_physical_stripe0()
 {
tests/btrfs/158 +1 -1
index fe2dd956..603e8bea 100755
@@ -41,6 +41,7 @@ _supported_fs btrfs
 _supported_os Linux
 _require_scratch_dev_pool 4
 _require_btrfs_command inspect-internal dump-tree
+_require_btrfs_fs_feature raid56
 
 get_physical_stripe0()
 {
--

2.16.4

Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”
#10 lore raw

PATCH 5/7 btrfs/023: skip trying to test raid56 without kernel support

In reply to [email protected]

From: Jeff Mahoney <[email protected]>

Older kernels don't support raid56. This test is still valid for other profiles, so skip raid56 if the kernel doesn't support it.

---
 tests/btrfs/023 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tests/btrfs/023 +6 -4
index 6d9cc443..6c02113b 100755
@@ -63,11 +63,13 @@ check_group_profile "RAID1"
 create_group_profile "raid10"
 check_group_profile "RAID10"
 
-create_group_profile "raid5"
-check_group_profile "RAID5"
+if [ -e "/sys/fs/btrfs/features/raid56" ]; then
+	create_group_profile "raid5"
+	check_group_profile "RAID5"
 
-create_group_profile "raid6"
-check_group_profile "RAID6"
+	create_group_profile "raid6"
+	check_group_profile "RAID6"
+fi
 
 # success, all done
 echo "Silence is golden"
Signature · 1 line
2.16.4
Reviewed-by on v1 5/7
#11 lore raw

Re: [PATCH 5/7] btrfs/023: skip trying to test raid56 without kernel support

Quoted 7 lines · On Mon, Jan 21, 2019 at 4:33 PM <[email protected]> wrote:

From: Jeff Mahoney <[email protected]>

Older kernels don't support raid56. This test is still valid for other profiles, so skip raid56 if the kernel doesn't support it.

Looks good. Since it's a btrfs specific change/fix, it would have been a good idea to cc linux-btrfs.

Quoted 29 lines
---
 tests/btrfs/023 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
tests/btrfs/023 +6 -5
index 6d9cc443..6c02113b 100755
@@ -63,11 +63,13 @@ check_group_profile "RAID1"
 create_group_profile "raid10"
 check_group_profile "RAID10"
 
-create_group_profile "raid5"
-check_group_profile "RAID5"
+if [ -e "/sys/fs/btrfs/features/raid56" ]; then
+       create_group_profile "raid5"
+       check_group_profile "RAID5"
 
-create_group_profile "raid6"
-check_group_profile "RAID6"
+       create_group_profile "raid6"
+       check_group_profile "RAID6"
+fi
 
 # success, all done
 echo "Silence is golden"
--

2.16.4

Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”
#12 lore raw

PATCH 6/7 btrfs/131: require support for free-space-tree

In reply to [email protected]

From: Jeff Mahoney <[email protected]>

btrfs/131 tests the free space tree, which older kernels won't have. We shouldn't run there.

---
 tests/btrfs/131 | 1 +
 1 file changed, 1 insertion(+)
tests/btrfs/131 +1 -0
index 0da1e7be..3de7eef8 100755
@@ -34,6 +34,7 @@ _supported_fs btrfs
 _supported_os Linux
 _require_scratch
 _require_btrfs_command inspect-internal dump-super
+_require_btrfs_fs_feature free_space_tree
 
 mkfs_v1()
 {
Signature · 1 line
2.16.4
Reviewed-by on v1 6/7
#13 lore raw

Re: [PATCH 6/7] btrfs/131: require support for free-space-tree

Quoted 7 lines · On Mon, Jan 21, 2019 at 4:33 PM <[email protected]> wrote:

From: Jeff Mahoney <[email protected]>

btrfs/131 tests the free space tree, which older kernels won't have. We shouldn't run there.

Looks good. Since it's a btrfs specific change/fix, it would have been a good idea to cc linux-btrfs.

Quoted 19 lines
---
 tests/btrfs/131 | 1 +
 1 file changed, 1 insertion(+)
tests/btrfs/131 +1 -1
index 0da1e7be..3de7eef8 100755
@@ -34,6 +34,7 @@ _supported_fs btrfs
 _supported_os Linux
 _require_scratch
 _require_btrfs_command inspect-internal dump-super
+_require_btrfs_fs_feature free_space_tree
 
 mkfs_v1()
 {
--

2.16.4

Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”
#14 lore raw

PATCH 7/7 check: move test exclusion handling to _prepare_test_list

In reply to [email protected]

From: Jeff Mahoney <[email protected]>

In order to simplify combining excluded tests specified on the command line vs specified via config files, it makes sense to push the handling into _prepare_test_list. This means we start with a fresh $tmp.xlist and rebuild it each time _prepare_test_list is called.

---
 check | 41 ++++++++++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 17 deletions(-)
check +24 -17
index 77a06b00..17073c4e 100755
@@ -230,7 +230,28 @@ _prepare_test_list()
 		done
 	fi
 
-	# Specified groups to exclude
+	:> $tmp.xlist
+
+	# Per-fstype/generic/shared file of tests to exclude (-X)
+	for xfile in $XGROUP_FILES; do
+		for d in $SRC_GROUPS $FSTYP; do
+			[ -f $SRC_DIR/$d/$xfile ] || continue
+			for f in `sed "s/#.*$//" $SRC_DIR/$d/$xfile`; do
+				echo "$d/$f command line" >> $tmp.xlist
+			done
+		done
+	done
+
+	# External file of tests to exclude (-E)
+	for xfile in $EXCLUDE_FILES; do
+		if [ -f $xfile ]; then
+			sed -e "s/#.*$//" \
+			    -e "s;$; file $xfile;" "$xfile" \
+			    >> $tmp.xlist
+	        fi
+	done
+
+	# Specified groups to exclude (-x)
 	for xgroup in $XGROUP_LIST; do
 		list=$(get_group_list $xgroup)
 		if [ -z "$list" ]; then
@@ -273,13 +294,8 @@ while [ $# -gt 0 ]; do
 		XGROUP_LIST="$XGROUP_LIST ${xgroup//,/ }"
 		;;
 
-	-X)	subdir_xfile=$2; shift ;
-		;;
-	-E)	xfile=$2; shift ;
-		if [ -f $xfile ]; then
-			sed "s/#.*$//" "$xfile" >> $tmp.xlist
-	        fi
-		;;
+	-X)	XGROUP_FILES="$XGROUP_FILES $2" ; shift ;;
+	-E)	EXCLUDE_FILES="$EXCLUDE_FILES $2" ; shift ;;
 	-s)	RUN_SECTION="$RUN_SECTION $2"; shift ;;
 	-S)	EXCLUDE_SECTION="$EXCLUDE_SECTION $2"; shift ;;
 	-l)	diff="diff" ;;
@@ -320,15 +336,6 @@ if ! . ./common/rc; then
 	exit 1
 fi
 
-if [ -n "$subdir_xfile" ]; then
-	for d in $SRC_GROUPS $FSTYP; do
-		[ -f $SRC_DIR/$d/$subdir_xfile ] || continue
-		for f in `sed "s/#.*$//" $SRC_DIR/$d/$subdir_xfile`; do
-			echo $d/$f >> $tmp.xlist
-		done
-	done
-fi
-
 # Process tests from command line now.
 if $have_test_arg; then
 	while [ $# -gt 0 ]; do
Signature · 1 line
2.16.4
#15 lore raw

Re: [PATCH 7/7] check: move test exclusion handling to _prepare_test_list

Quoted 4 lines · On Mon, Jan 21, 2019 at 11:33:16AM -0500, [email protected] wrote:

From: Jeff Mahoney <[email protected]>

In order to simplify combining excluded tests specified on the command line vs specified via config files,

You mean defining excludes in configs/<hostname>.config files, right? i.e. in config sections?

But the section code only calls _prepare_test_list if the test dev is recreated by each section, right? So you can't really change the expunge list from the config files without forcing a test dev reformat, right?

Quoted 3 lines

it makes sense to push the handling
into _prepare_test_list. This means we start with a fresh $tmp.xlist and rebuild it each time _prepare_test_list is called.

The patch does more than that, right?

Quoted 10 lines
---
 check | 41 ++++++++++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 17 deletions(-)
check +0 -0
index 77a06b00..17073c4e 100755

check _prepare_test_list() · line 236

Quoted 8 lines
check +4 -1
@@ -230,7 +230,28 @@ _prepare_test_list()
 		done
 	fi
 
-	# Specified groups to exclude
+	:> $tmp.xlist
+
+	# Per-fstype/generic/shared file of tests to exclude (-X)
+	for xfile in $XGROUP_FILES; do

That adds support for multiple group exclude files (i.e. multiple -X options), right?

check _prepare_test_list() · line 249

Quoted 13 lines
check +13 -0
+		for d in $SRC_GROUPS $FSTYP; do
+			[ -f $SRC_DIR/$d/$xfile ] || continue
+			for f in `sed "s/#.*$//" $SRC_DIR/$d/$xfile`; do
+				echo "$d/$f command line" >> $tmp.xlist
+			done
+		done
+	done
+
+	# External file of tests to exclude (-E)
+	for xfile in $EXCLUDE_FILES; do
+		if [ -f $xfile ]; then
+			sed -e "s/#.*$//" \
+			    -e "s;$; file $xfile;" "$xfile" \

And I have no idea what problem this second expression is solving - it wasn't in the original code that got copied here.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#16 lore raw

Re: [PATCH 7/7] check: move test exclusion handling to _prepare_test_list

Quoted 8 lines · Dave Chinner
Quoted 4 lines · On Mon, Jan 21, 2019 at 11:33:16AM -0500, [email protected] wrote:

From: Jeff Mahoney <[email protected]>

In order to simplify combining excluded tests specified on the command line vs specified via config files,

You mean defining excludes in configs/<hostname>.config files, right? i.e. in config sections?

Yes.

Quoted 4 lines

But the section code only calls _prepare_test_list if the test dev is recreated by each section, right? So you can't really change the expunge list from the config files without forcing a test dev reformat, right?

Right. In my testing I didn't hit this situation, but it's there. I can fix that.

Quoted 19 lines
Quoted 3 lines

it makes sense to push the handling
into _prepare_test_list. This means we start with a fresh $tmp.xlist and rebuild it each time _prepare_test_list is called.

The patch does more than that, right?

Quoted 13 lines
---
 check | 41 ++++++++++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 17 deletions(-)
check +0 -0
index 77a06b00..17073c4e 100755
@@ -230,7 +230,28 @@ _prepare_test_list()
 		done
 	fi
 
Quoted 8 lines

check _prepare_test_list() · line 236

Quoted 5 lines
check +4 -1
-	# Specified groups to exclude
+	:> $tmp.xlist
+
+	# Per-fstype/generic/shared file of tests to exclude (-X)
+	for xfile in $XGROUP_FILES; do

That adds support for multiple group exclude files (i.e. multiple -X options), right?

Yes. I'll document that in the commit message.

Quoted 8 lines
Quoted 8 lines
check +8 -0
+		for d in $SRC_GROUPS $FSTYP; do
+			[ -f $SRC_DIR/$d/$xfile ] || continue
+			for f in `sed "s/#.*$//" $SRC_DIR/$d/$xfile`; do
+				echo "$d/$f command line" >> $tmp.xlist
+			done
+		done
+	done
+
Quoted 8 lines

check _prepare_test_list() · line 249

Quoted 5 lines
check +5 -0
+	# External file of tests to exclude (-E)
+	for xfile in $EXCLUDE_FILES; do
+		if [ -f $xfile ]; then
+			sed -e "s/#.*$//" \
+			    -e "s;$; file $xfile;" "$xfile" \

And I have no idea what problem this second expression is solving - it wasn't in the original code that got copied here.

This series is part of a larger set I've been using for a while. I reordered them and pulled out the least controversial. This was originally after a patch that adds reporting for why a test was expunged to the check output. We can ignore this part for now.

Thanks for the review,

-Jeff

Signature · 2 lines
Jeff Mahoney
SUSE Labs
Reviewed-by on v1 1/7
#17 lore raw
In reply to [email protected]
Quoted 2 lines · On Mon, Jan 21, 2019 at 4:33 PM <[email protected]> wrote:

From: Jeff Mahoney <[email protected]>

Looks good. Since it's a btrfs specific change/fix, it would have been a good idea to cc linux-btrfs.

Quoted 46 lines

Older kernels don't have /sys/fs/btrfs. btrfs/010 will happily run until it goes to check its work against sysfs and finds those files don't exist. This patch introduces a require check to ensure that the sysfs files are present before running.

---
 common/btrfs    | 8 ++++++++
 tests/btrfs/010 | 1 +
 2 files changed, 9 insertions(+)
common/btrfs +8 -0
index 26dc0bb9..f6513c06 100644
@@ -89,6 +89,14 @@ _require_btrfs_fs_feature()
                _notrun "Feature $feat not supported by the available btrfs version"
 }
 
+_require_btrfs_fs_sysfs()
+{
+       modprobe btrfs > /dev/null 2>&1
+       [ -e /sys/fs/btrfs/features ] || \
+               _notrun "Sysfs not supported by the available btrfs version"
+
+}
+
 _check_btrfs_filesystem()
 {
        device=$1
tests/btrfs/010 +1 -1
index 1a5f0146..72b2c727 100755
@@ -33,6 +33,7 @@ rm -f $seqres.full
 _supported_fs btrfs
 _supported_os Linux
 _require_test
+_require_btrfs_fs_sysfs
 
 # Create 32k extents. All of these extents will be accounted as outstanding and
 # reserved.
--

2.16.4

Signature · 3 lines
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”