Skip to contentSkip to conversation

: generic/453: Do NOT run for FSs restricting names

PATCH Superseded Pavel Reichl 3 participants 6 messages Jul 7, 2021 – Jul 8, 2021

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover : generic/453: Do NOT run for FSs restricting names

Hello,

this is a quick attempt to finish what was discussed in thread:

	generic/453: Exclude filenames that are not supported by exfat
	https://www.spinics.net/lists/fstests/msg16328.html

Based on Darrick's comments:

"""
TBH I think these tests (g/453 and g/454) are probably only useful for filesystems that allow unrestricted byte streams for names. """

and

"""
Nowadays with wider testing of other filesystems (thanks, Red Hat!) we should hide these behind _require_names_are_bytes or move them to tests/xfs/.
"""

Pavel Reichl (1):
generic/453: Do NOT run for FSs restricting names

 common/rc         | 11 +++++++++++
 tests/generic/453 |  1 +
 2 files changed, 12 insertions(+)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 generic/453: Do NOT run for FSs restricting names

Running generic/453 test is probably only useful for filesystems that allow unrestricted byte streams for names.

---
 common/rc         | 11 +++++++++++
 tests/generic/453 |  1 +
 2 files changed, 12 insertions(+)
common/rc +11 -0
index d4ad421e..7a352445 100644
@@ -4599,6 +4599,17 @@ _require_od_endian_flag()
 		_notrun "od does not support endian flag"
 }
 
+_require_names_are_bytes() {
+        case "$FSTYP" in
+        ext2|ext3|ext4|xfs|btrfs)
+		# do nothing
+	        ;;
+	*)
+                _notrun "$FSTYP does now allow unrestricted byte streams for names"
+		;;
+        esac
+}
+
 init_rc
 
 ################################################################################
tests/generic/453 +1 -0
index 55ddcc01..a0fb802e 100755
@@ -15,6 +15,7 @@ _begin_fstest auto quick dir
 # Import common functions.
 
 _require_scratch
+_require_names_are_bytes
 
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
Signature · 1 line
2.31.1
#2 lore raw

Re: [PATCH 1/1] generic/453: Do NOT run for FSs restricting names

Quoted 15 lines · Pavel Reichl

Running generic/453 test is probably only useful for filesystems that allow unrestricted byte streams for names.

---
 common/rc         | 11 +++++++++++
 tests/generic/453 |  1 +
 2 files changed, 12 insertions(+)
common/rc +0 -0
index d4ad421e..7a352445 100644

common/rc _require_od_endian_flag() · line 4602

Quoted 4 lines
common/rc +1 -0
@@ -4599,6 +4599,17 @@ _require_od_endian_flag()
 		_notrun "od does not support endian flag"
 }
 
+_require_names_are_bytes() {

This helper needs a short description.

# Skip this test unless the filesystem treats names (directory entries,

# fs labels, and extended attribute names) as raw byte sequences.

common/rc _require_od_endian_flag() · line 4604

Quoted 2 lines
common/rc +2 -0
+        case "$FSTYP" in
+        ext2|ext3|ext4|xfs|btrfs)

Does this need to _notrun ext4 filesystems that have casefolding enabled? (Or: should we let the ext4 developers figure that out?)

Quoted 16 lines
common/rc +8 -0
+		# do nothing
+	        ;;
+	*)
+                _notrun "$FSTYP does now allow unrestricted byte streams for names"
+		;;
+        esac
+}
+
 init_rc
 
 ################################################################################
tests/generic/453 +0 -0
index 55ddcc01..a0fb802e 100755

tests/generic/453 _begin_fstest auto quick dir · line 18

Quoted 4 lines
tests/generic/453 +1 -0
@@ -15,6 +15,7 @@ _begin_fstest auto quick dir
 # Import common functions.
 
 _require_scratch
+_require_names_are_bytes

Do you need this for generic/454 as well?

--D

Quoted 6 lines
tests/generic/453 +0 -0
 echo "Format and mount"
 _scratch_mkfs > $seqres.full 2>&1
Signature · 1 line
2.31.1
#3 lore raw

Re: [PATCH 1/1] generic/453: Do NOT run for FSs restricting names

Quoted 8 lines · Darrick J. Wong

# Skip this test unless the filesystem treats names (directory entries,

# fs labels, and extended attribute names) as raw byte sequences.

common/rc _require_od_endian_flag() · line 4604

Quoted 2 lines
common/rc +2 -0
+        case "$FSTYP" in
+        ext2|ext3|ext4|xfs|btrfs)

Does this need to _notrun ext4 filesystems that have casefolding enabled? (Or: should we let the ext4 developers figure that out?)

Casefolding has to be enabled on the file system level (mkfs.ext4 -O casefold) but also on a per-directory level (by setting the casefold flag). Otherwise, unrestricted byte streams are allowed for file names. Since generic/453 doesn't set the casefold flag, this tests passes even when the scratch mount options include casefolding.

The generic/556 test will test casefolding.

BTW, we should probably include f2fs as a file system which normally allow unrestricted byte streams. F2fs also supports casefolding, but again, like ext4, it's only enabled when the per-directory casefold flag is enabled. So:

+ case "$FSTYP" in
+ ext2|ext3|ext4|f2fs|xfs|btrfs)

I've verified that generic/453 passes on f2fs today.

- Ted

#4 lore raw

Re: [PATCH 1/1] generic/453: Do NOT run for FSs restricting names

Quoted 8 lines · Theodore Ts'o

BTW, we should probably include f2fs as a file system which normally allow unrestricted byte streams. F2fs also supports casefolding, but again, like ext4, it's only enabled when the per-directory casefold flag is enabled. So:

(quoted diff) +2 -0
+        case "$FSTYP" in
+        ext2|ext3|ext4|f2fs|xfs|btrfs)
Quoted 4 lines

I've verified that generic/453 passes on f2fs today.

- Ted

Hi Ted, thanks for the info. I'll update the patch to contain f2fs.

Reviewed-by on v1 1/1
#5 lore raw

Re: [PATCH 1/1] generic/453: Do NOT run for FSs restricting names

In reply to Pavel Reichl

common/rc _require_od_endian_flag() · line 4608

Quoted 7 lines · Pavel Reichl
common/rc +7 -0
+_require_names_are_bytes() {
+        case "$FSTYP" in
+        ext2|ext3|ext4|xfs|btrfs)
+		# do nothing
+	        ;;
+	*)
+                _notrun "$FSTYP does now allow unrestricted byte streams for names"

"now" should be "not" above, I believe.

Other than that,

- Ted