Skip to contentSkip to conversation

xfstests: Check concurrently of readdir and read on the same directory fd

PATCH In review Zhao Hongjiang 2 participants 3 messages Apr 3, 2013 – Apr 5, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: Check concurrently of readdir and read on the same directory fd

From: Zhao Hongjiang <[email protected]>

Check if there are two threads,one keeps calling read() or lseek(), and the other calling readdir(), both on the same directory fd.

Based on a testcase from Li Zefan <[email protected]>.
http://marc.info/?l=linux-kernel&m=136123703211869&w=2

---
 src/Makefile          |    2 +-
 src/t_readdir_1.c     |   46 +++++++++++++++++++++++++++++
 src/t_readdir_2.c     |   57 ++++++++++++++++++++++++++++++++++++
 tests/generic/308     |   76 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/308.out |    2 +
 tests/generic/group   |    1 +
 6 files changed, 183 insertions(+), 1 deletions(-)
 create mode 100644 src/t_readdir_1.c
 create mode 100644 src/t_readdir_2.c
 create mode 100755 tests/generic/308
 create mode 100644 tests/generic/308.out
src/Makefile +1 -1
index f7362a2..8d8e97f 100644
@@ -18,7 +18,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
 	locktest unwritten_mmap bulkstat_unlink_test t_stripealign \
 	bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \
 	stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \
-	seek_copy_test
+	seek_copy_test t_readdir_1 t_readdir_2
 
 SUBDIRS =
 
src/t_readdir_1.c new file +46 -0

46 lines not on this page · raw message

src/t_readdir_2.c new file +57 -0

57 lines not on this page · raw message

tests/generic/308 new file +76 -0

76 lines not on this page · raw message

tests/generic/308.out new file +2 -0
new file mode 100644
index 0000000..904ad4d
@@ -0,0 +1,2 @@
+QA output created by 308
+*** done
tests/generic/group +1 -0
index 450e942..a924086 100644
@@ -109,3 +109,4 @@
 299 auto aio enospc rw stress
 300 auto aio enospc preallocrw stress
 306 auto quick rw
+308 auto

-- 1.7.1

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

Zhao,

Thanks for submitting this test.

Only two minor errors that will be corrected at commit time.

1. The new script used generate this test produces errors. No need to resubmit, this has already been fixed by commit 8575764a "xfstests: fix common source file path"

QA output created by 310
+./tests/generic/310: line 43: ./common.rc: No such file or directory +./tests/generic/310: line 44: ./common.filter: No such file or
directory
+./tests/generic/310: line 47: _supported_fs: command not found +./tests/generic/310: line 48: _supported_os: command not found

2. Whitespace errors
Warning: trailing whitespace in line 18 of src/t_readdir_2.c
Warning: trailing whitespace in lines 18,28 of src/t_readdir_1.c

space before tab in indent. tests/generic/310

                                	perror("Seek failed!");

warning: 1 line adds whitespace errors.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#2 lore raw
In reply to Zhao Hongjiang

Zhao,

Thanks for submitting this test, it has been committed.

--Rich
commit bbaf78c01bc98b2afc3bb3d31eac38fc5d4b3b19

Author: Zhao Hongjiang <[email protected]>
Date:   Wed Apr 3 06:09:10 2013 +0000

xfstests generic 310: check concurrently of readdir and read on the
same directory fd

Check if there are two threads,one keeps calling read() or lseek(), and the other calling readdir(), both on the same directory fd.

Based on a testcase from Li Zefan <[email protected]>.
http://marc.info/?l=linux-kernel&m=136123703211869&w=2

[[email protected] minor white space fixes and test renumbering]