Skip to contentSkip to conversation

tests: add another test for uninit extents past eof

PATCH RESEND Applied Eric Whitney 2 participants 2 messages Sep 23, 2013 – Sep 30, 2013

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 tests: add another test for uninit extents past eof

Commit d3f32c2db8 was intended to detect extents found outside their proper location in the extent tree, including invalid extents at the end of an extent block. However, it incorrectly reported legal uninitialized extents created by fallocate() at the end of file with the FALLOC_FL_KEEP_SIZE flag as false positives. xfstests generic/263 (among others) caught this problem, while the e2fsprogs test f_uninit_ext_past_eof did not. The latter test failed to detect the problem in part because it uses a test file whose i_size is 0.

Add a test derived from the fsx-based test case in xfstests generic/263 consisting of a file with non-zero length, more than four extents total, and two uninitialized extents past EOF to reliably reproduce commit d3f32c2db8's false positive behavior.

---
 tests/f_uninit_ext_past_eof2/expect.1 |    7 +++++++
 tests/f_uninit_ext_past_eof2/expect.2 |    7 +++++++
 tests/f_uninit_ext_past_eof2/image.gz |  Bin 0 -> 989 bytes
 tests/f_uninit_ext_past_eof2/name     |    1 +
 4 files changed, 15 insertions(+)
 create mode 100644 tests/f_uninit_ext_past_eof2/expect.1
 create mode 100644 tests/f_uninit_ext_past_eof2/expect.2
 create mode 100644 tests/f_uninit_ext_past_eof2/image.gz
 create mode 100644 tests/f_uninit_ext_past_eof2/name
tests/f_uninit_ext_past_eof2/expect.1 new file +7 -0
new file mode 100644
index 0000000..eb8248e
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 12/16 files (8.3% non-contiguous), 70/100 blocks
+Exit status is 0
tests/f_uninit_ext_past_eof2/expect.2 new file +7 -0
new file mode 100644
index 0000000..eb8248e
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 12/16 files (8.3% non-contiguous), 70/100 blocks
+Exit status is 0
tests/f_uninit_ext_past_eof2/image.gz new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..c739e499475a47d2ebc8247a5e448b4bba310e33
GIT binary patch
tests/f_uninit_ext_past_eof2/name new file +1 -0
new file mode 100644
index 0000000..352a0f5
@@ -0,0 +1 @@
+fallocated extents after nonzero i_size and total extents > 4
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 10 lines · Eric Whitney

Commit d3f32c2db8 was intended to detect extents found outside their proper location in the extent tree, including invalid extents at the end of an extent block. However, it incorrectly reported legal uninitialized extents created by fallocate() at the end of file with the FALLOC_FL_KEEP_SIZE flag as false positives. xfstests generic/263 (among others) caught this problem, while the e2fsprogs test f_uninit_ext_past_eof did not. The latter test failed to detect the problem in part because it uses a test file whose i_size is 0.

Quoted 6 lines

Add a test derived from the fsx-based test case in xfstests generic/263 consisting of a file with non-zero length, more than four extents total, and two uninitialized extents past EOF to reliably reproduce commit d3f32c2db8's false positive behavior.

Applied, thanks.

- Ted