"Darrick J. Wong" <djwong@xxxxxxxxxx> writes: > On Wed, Apr 28, 2021 at 09:50:56AM -0400, Theodore Ts'o wrote: >> On Tue, Apr 27, 2021 at 11:11:16AM -0700, Darrick J. Wong wrote: >> > >> > TBH I think these tests (g/453 and g/454) are probably only useful for >> > filesystems that allow unrestricted byte streams for names. >> >> I'm actually a little puzzled about why these tests should exist: >> >> # Create a directory with multiple filenames that all appear the same >> # (in unicode, anyway) but point to different inodes. In theory all >> # Linux filesystems should allow this (filenames are a sequence of >> # arbitrary bytes) even if the user implications are horrifying. >> >> Why do we care about testing this? The assertion "In all theory all >> Linux filesystems should allow this" is clearly not true --- if you >> enable unicode support for ext4 or f2fs, this will no longer be true, >> and this is considered by some a _feature_ not a bug --- precisely >> _because_ the user implications are horrifying. >> >> So why does these tests exist? Darrick, I see you added them in 2017 >> to test whether or not xfs_scrub will warn about confuable names, if >> _check_xfs_scrub_does_unicode is true. So we already understand that >> it's possible for a file system checker to complain that these file >> names are bad. > > Yes, that's exactly why this test (and generic/454) were created -- as a > functional test for xfs_scrub's unicode checking. > >> It's not at all clear to me that asserting that all Linux file systems >> _must_ treat file names as "bag of bits" and not apply any kind of >> unicode normalization or strict unicode validation is a valid thing to >> test for in 2021. > > Perhaps not. These two tests do have the interesting side effect of > catching filesystems that don't hew to the "names are bytestreams" > philosophy. In 2017, fstests usage seemed like it pretty narrowly > included only the big three filesystems, so it amuses me to no end that > four years went by before this discussion started. :P > > 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/. > > Question -- the unicode case folding doesn't apply to xattr names, > right? No, they don't apply to xattr name in ext4 and f2fs. -- Gabriel Krisman Bertazi