generic/396: test correct d_type value
PATCH 1/1 generic/396: test correct d_type value
Verify correct d_type values of dir enrties.
This test would fail for file systems with no d_type support, but I have no idea how to test d_type support in a generic way, without confusing a bug of d_type = DT_UNKNOWN with no support.
I wonder if anybody is interested in testing a file system with no d_type support.
--- .gitignore | 1 + src/Makefile | 2 +- src/t_dir_type.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/396 | 72 ++++++++++++++++++++++++++++++++++ tests/generic/396.out | 7 ++++ tests/generic/group | 1 + 6 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 src/t_dir_type.c create mode 100755 tests/generic/396 create mode 100644 tests/generic/396.out
.gitignore +1 -0
@@ -94,6 +94,7 @@ /src/t_access_root /src/t_dir_offset /src/t_dir_offset2 +/src/t_dir_type /src/t_futimens /src/t_getcwd /src/t_holes
src/Makefile +1 -1
@@ -21,7 +21,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \ stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \ seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \ renameat2 t_getcwd e4compact test-nextquota punch-alternating \ - attr-list-by-handle-cursor-test listxattr dio-interleaved + attr-list-by-handle-cursor-test listxattr dio-interleaved t_dir_type SUBDIRS =
src/t_dir_type.c new file +106 -0
106 lines not on this page · raw message
tests/generic/396 new file +72 -0
72 lines not on this page · raw message
tests/generic/396.out new file +7 -0
@@ -0,0 +1,7 @@ +QA output created by 396 +d_name = d, d_type = d +d_name = f, d_type = f +d_name = l, d_type = l +d_name = c, d_type = c +d_name = b, d_type = b +d_name = p, d_type = p
tests/generic/group +1 -0
@@ -397,3 +397,4 @@ 392 auto quick metadata 393 auto quick rw 394 auto quick +396 auto quick
Signature · 1 line
2.7.4
Quoted 5 lines · Amir Goldstein
Verify correct
d_typevalues of dir enrties.This test would fail for file systems with no
d_typesupport, but I have no idea how to testd_typesupport in a generic way, without confusing a bug ofd_type=DT_UNKNOWNwith no support.
XFS v4 without the rare ftype feature is such a file system.
We'll need to detect it, and I think a large enough directory where all entries but . and .. are DT_UNKNOWN should be a clear indicator.
If that's a bug it's clearly not distinguishable from a non-buggy fs :)
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Amir Goldstein
Verify correct
d_typevalues of dir enrties.This test would fail for file systems with no
d_typesupport, but I have no idea how to testd_typesupport in a generic way, without confusing a bug ofd_type=DT_UNKNOWNwith no support.
Quoted 6 lines
XFS v4 without the rare ftype feature is such a file system.
We'll need to detect it, and I think a large enough directory where all entries but . and .. are
DT_UNKNOWNshould be a clear indicator.If that's a bug it's clearly not distinguishable from a non-buggy fs :)
For xfs and ext* I know how to test if the feature is enabled and I probably should do that. The question is what to do with the rest of the fs. I can do the heuristic test you suggested...