]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
tests: add tests for uninitialized bitmaps
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 12 Apr 2012 23:52:44 +0000 (17:52 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 19 Aug 2019 01:58:35 +0000 (21:58 -0400)
Various tests for handing uninitialized block and inode bitmaps,
and inodes beyond the in-use high watermark.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
32 files changed:
tests/f_uninit_bad_free_inodes/expect.1 [new file with mode: 0644]
tests/f_uninit_bad_free_inodes/expect.2 [new file with mode: 0644]
tests/f_uninit_bad_free_inodes/image.gz [new file with mode: 0644]
tests/f_uninit_bad_free_inodes/name [new file with mode: 0644]
tests/f_uninit_blk_used_not_set/expect.1 [new file with mode: 0644]
tests/f_uninit_blk_used_not_set/expect.2 [new file with mode: 0644]
tests/f_uninit_blk_used_not_set/image.gz [new file with mode: 0644]
tests/f_uninit_blk_used_not_set/name [new file with mode: 0644]
tests/f_uninit_checksum_bad/expect.1 [new file with mode: 0644]
tests/f_uninit_checksum_bad/expect.2 [new file with mode: 0644]
tests/f_uninit_checksum_bad/image.gz [new file with mode: 0644]
tests/f_uninit_checksum_bad/name [new file with mode: 0644]
tests/f_uninit_disable/expect.1 [new file with mode: 0644]
tests/f_uninit_disable/expect.2 [new file with mode: 0644]
tests/f_uninit_disable/image.gz [new file with mode: 0644]
tests/f_uninit_disable/name [new file with mode: 0644]
tests/f_uninit_enable/expect.1 [new file with mode: 0644]
tests/f_uninit_enable/expect.2 [new file with mode: 0644]
tests/f_uninit_enable/image.gz [new file with mode: 0644]
tests/f_uninit_enable/name [new file with mode: 0644]
tests/f_uninit_inode_past_unused/expect.1 [new file with mode: 0644]
tests/f_uninit_inode_past_unused/expect.2 [new file with mode: 0644]
tests/f_uninit_inode_past_unused/image.gz [new file with mode: 0644]
tests/f_uninit_inode_past_unused/name [new file with mode: 0644]
tests/f_uninit_restart_fsck/expect.1 [new file with mode: 0644]
tests/f_uninit_restart_fsck/expect.2 [new file with mode: 0644]
tests/f_uninit_restart_fsck/image.gz [new file with mode: 0644]
tests/f_uninit_restart_fsck/name [new file with mode: 0644]
tests/f_uninit_set_inode_not_set/expect.1 [new file with mode: 0644]
tests/f_uninit_set_inode_not_set/expect.2 [new file with mode: 0644]
tests/f_uninit_set_inode_not_set/image.gz [new file with mode: 0644]
tests/f_uninit_set_inode_not_set/name [new file with mode: 0644]

diff --git a/tests/f_uninit_bad_free_inodes/expect.1 b/tests/f_uninit_bad_free_inodes/expect.1
new file mode 100644 (file)
index 0000000..23d7b1f
--- /dev/null
@@ -0,0 +1,25 @@
+Group descriptor 1 has invalid unused inodes count 2048.  Fix? yes
+
+Group descriptor 2 has invalid unused inodes count 1344.  Fix? yes
+
+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
+Free inodes count wrong for group #1 (490, counted=2048).
+Fix? yes
+
+Free inodes count wrong for group #2 (250, counted=1344).
+Fix? yes
+
+Free inodes count wrong for group #3 (1967, counted=1969).
+Fix? yes
+
+Free inodes count wrong (4744, counted=7398).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 794/8192 files (0.4% non-contiguous), 8473/32768 blocks
+Exit status is 1
diff --git a/tests/f_uninit_bad_free_inodes/expect.2 b/tests/f_uninit_bad_free_inodes/expect.2
new file mode 100644 (file)
index 0000000..431227b
--- /dev/null
@@ -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: 794/8192 files (0.4% non-contiguous), 8473/32768 blocks
+Exit status is 0
diff --git a/tests/f_uninit_bad_free_inodes/image.gz b/tests/f_uninit_bad_free_inodes/image.gz
new file mode 100644 (file)
index 0000000..3e6218b
Binary files /dev/null and b/tests/f_uninit_bad_free_inodes/image.gz differ
diff --git a/tests/f_uninit_bad_free_inodes/name b/tests/f_uninit_bad_free_inodes/name
new file mode 100644 (file)
index 0000000..8bd3180
--- /dev/null
@@ -0,0 +1 @@
+bad free inode count, but good checksum
diff --git a/tests/f_uninit_blk_used_not_set/expect.1 b/tests/f_uninit_blk_used_not_set/expect.1
new file mode 100644 (file)
index 0000000..9e473f8
--- /dev/null
@@ -0,0 +1,34 @@
+Group descriptor 1 has invalid unused inodes count 2048.  Fix? yes
+
+Group descriptor 2 has invalid unused inodes count 2048.  Fix? yes
+
+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
+Group 1 block(s) in use but group is marked BLOCK_UNINIT
+Fix? yes
+
+Block bitmap differences:  +(8585--8777)
+Fix? yes
+
+Free blocks count wrong for group #2 (0, counted=7934).
+Fix? yes
+
+Free blocks count wrong (19530, counted=27464).
+Fix? yes
+
+Free inodes count wrong for group #1 (0, counted=2048).
+Fix? yes
+
+Free inodes count wrong for group #2 (0, counted=2048).
+Fix? yes
+
+Free inodes count wrong (4084, counted=8180).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 12/8192 files (8.3% non-contiguous), 5304/32768 blocks
+Exit status is 1
diff --git a/tests/f_uninit_blk_used_not_set/expect.2 b/tests/f_uninit_blk_used_not_set/expect.2
new file mode 100644 (file)
index 0000000..17d0cfa
--- /dev/null
@@ -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/8192 files (8.3% non-contiguous), 5304/32768 blocks
+Exit status is 0
diff --git a/tests/f_uninit_blk_used_not_set/image.gz b/tests/f_uninit_blk_used_not_set/image.gz
new file mode 100644 (file)
index 0000000..6316285
Binary files /dev/null and b/tests/f_uninit_blk_used_not_set/image.gz differ
diff --git a/tests/f_uninit_blk_used_not_set/name b/tests/f_uninit_blk_used_not_set/name
new file mode 100644 (file)
index 0000000..e6ee718
--- /dev/null
@@ -0,0 +1 @@
+blocks used but block uninit set
diff --git a/tests/f_uninit_checksum_bad/expect.1 b/tests/f_uninit_checksum_bad/expect.1
new file mode 100644 (file)
index 0000000..4ff8a8b
--- /dev/null
@@ -0,0 +1,29 @@
+One or more block group descriptor checksums are invalid.  Fix? yes
+
+Group descriptor 1 checksum is 0xbbaa, should be 0xff0b.  FIXED.
+Group descriptor 2 has invalid unused inodes count 2048.  Fix? yes
+
+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
+Free blocks count wrong for group #2 (0, counted=7934).
+Fix? yes
+
+Free blocks count wrong (19286, counted=27220).
+Fix? yes
+
+Free inodes count wrong for group #1 (0, counted=2048).
+Fix? yes
+
+Free inodes count wrong for group #2 (0, counted=2048).
+Fix? yes
+
+Free inodes count wrong (4085, counted=8181).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 11/8192 files (0.0% non-contiguous), 5548/32768 blocks
+Exit status is 1
diff --git a/tests/f_uninit_checksum_bad/expect.2 b/tests/f_uninit_checksum_bad/expect.2
new file mode 100644 (file)
index 0000000..38f2334
--- /dev/null
@@ -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: 11/8192 files (0.0% non-contiguous), 5548/32768 blocks
+Exit status is 0
diff --git a/tests/f_uninit_checksum_bad/image.gz b/tests/f_uninit_checksum_bad/image.gz
new file mode 100644 (file)
index 0000000..8e91e01
Binary files /dev/null and b/tests/f_uninit_checksum_bad/image.gz differ
diff --git a/tests/f_uninit_checksum_bad/name b/tests/f_uninit_checksum_bad/name
new file mode 100644 (file)
index 0000000..b9e4a31
--- /dev/null
@@ -0,0 +1 @@
+invalid group descriptor checksum
diff --git a/tests/f_uninit_disable/expect.1 b/tests/f_uninit_disable/expect.1
new file mode 100644 (file)
index 0000000..f568bec
--- /dev/null
@@ -0,0 +1,10 @@
+Group descriptor 0 marked uninitialized without feature set.
+Fix? yes
+
+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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks
+Exit status is 1
diff --git a/tests/f_uninit_disable/expect.2 b/tests/f_uninit_disable/expect.2
new file mode 100644 (file)
index 0000000..4cd9aa9
--- /dev/null
@@ -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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks
+Exit status is 0
diff --git a/tests/f_uninit_disable/image.gz b/tests/f_uninit_disable/image.gz
new file mode 100644 (file)
index 0000000..38c7455
Binary files /dev/null and b/tests/f_uninit_disable/image.gz differ
diff --git a/tests/f_uninit_disable/name b/tests/f_uninit_disable/name
new file mode 100644 (file)
index 0000000..494b472
--- /dev/null
@@ -0,0 +1 @@
+disable uninit_bg feature
diff --git a/tests/f_uninit_enable/expect.1 b/tests/f_uninit_enable/expect.1
new file mode 100644 (file)
index 0000000..02801bf
--- /dev/null
@@ -0,0 +1,10 @@
+One or more block group descriptor checksums are invalid.  Fix? yes
+
+Group descriptor 0 checksum is 0x0000, should be 0x13f6.  FIXED.
+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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks
+Exit status is 1
diff --git a/tests/f_uninit_enable/expect.2 b/tests/f_uninit_enable/expect.2
new file mode 100644 (file)
index 0000000..4cd9aa9
--- /dev/null
@@ -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: 11/2048 files (0.0% non-contiguous), 306/8192 blocks
+Exit status is 0
diff --git a/tests/f_uninit_enable/image.gz b/tests/f_uninit_enable/image.gz
new file mode 100644 (file)
index 0000000..4da79c9
Binary files /dev/null and b/tests/f_uninit_enable/image.gz differ
diff --git a/tests/f_uninit_enable/name b/tests/f_uninit_enable/name
new file mode 100644 (file)
index 0000000..a818f5c
--- /dev/null
@@ -0,0 +1 @@
+enable uninit_bg feature
diff --git a/tests/f_uninit_inode_past_unused/expect.1 b/tests/f_uninit_inode_past_unused/expect.1
new file mode 100644 (file)
index 0000000..1cf5c85
--- /dev/null
@@ -0,0 +1,27 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Entry 'foo' in / (2) references inode 14 found in group 0's unused inodes area.
+Fix? yes
+
+Restarting e2fsck from the beginning...
+One or more block group descriptor checksums are invalid.  Fix? yes
+
+Group descriptor 0 checksum is 0x4c72, should be 0xde74.  FIXED.
+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
+Inode bitmap differences:  -12
+Fix? yes
+
+Free inodes count wrong for group #0 (2037, counted=2035).
+Fix? yes
+
+Free inodes count wrong (4073, counted=2035).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 13/2048 files (0.0% non-contiguous), 1336/8192 blocks
+Exit status is 1
diff --git a/tests/f_uninit_inode_past_unused/expect.2 b/tests/f_uninit_inode_past_unused/expect.2
new file mode 100644 (file)
index 0000000..bdb029e
--- /dev/null
@@ -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: 13/2048 files (0.0% non-contiguous), 1336/8192 blocks
+Exit status is 0
diff --git a/tests/f_uninit_inode_past_unused/image.gz b/tests/f_uninit_inode_past_unused/image.gz
new file mode 100644 (file)
index 0000000..9104a70
Binary files /dev/null and b/tests/f_uninit_inode_past_unused/image.gz differ
diff --git a/tests/f_uninit_inode_past_unused/name b/tests/f_uninit_inode_past_unused/name
new file mode 100644 (file)
index 0000000..95d07f1
--- /dev/null
@@ -0,0 +1 @@
+inode in use beyond bg_itable_unused
diff --git a/tests/f_uninit_restart_fsck/expect.1 b/tests/f_uninit_restart_fsck/expect.1
new file mode 100644 (file)
index 0000000..d396beb
--- /dev/null
@@ -0,0 +1,36 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Entry 'foo2' in /d1 (1881) references inode 500 found in group 0's unused inodes area.
+Fix? yes
+
+Entry 'foo2' in /d1 (1881) has an incorrect filetype (was 1, should be 0).
+Fix? yes
+
+Entry 'bar2' in /d2 (3761) references inode 2100 found in group 1's unused inodes area.
+Fix? yes
+
+Entry 'bar2' in /d2 (3761) has an incorrect filetype (was 1, should be 0).
+Fix? yes
+
+Restarting e2fsck from the beginning...
+One or more block group descriptor checksums are invalid.  Fix? yes
+
+Group descriptor 0 checksum is 0xb92b, should be 0x2b5f.  FIXED.
+Group descriptor 1 checksum is 0x2f53, should be 0x8d2f.  FIXED.
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Entry 'foo2' in /d1 (1881) has deleted/unused inode 500.  Clear? yes
+
+Entry 'bar2' in /d2 (3761) has deleted/unused inode 2100.  Clear? yes
+
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Unattached zero-length inode 1883.  Clear? yes
+
+Unattached zero-length inode 3763.  Clear? yes
+
+Pass 5: Checking group summary information
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 21/7520 files (0.0% non-contiguous), 2352/30000 blocks
+Exit status is 1
diff --git a/tests/f_uninit_restart_fsck/expect.2 b/tests/f_uninit_restart_fsck/expect.2
new file mode 100644 (file)
index 0000000..156eb07
--- /dev/null
@@ -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: 21/7520 files (0.0% non-contiguous), 2352/30000 blocks
+Exit status is 0
diff --git a/tests/f_uninit_restart_fsck/image.gz b/tests/f_uninit_restart_fsck/image.gz
new file mode 100644 (file)
index 0000000..f073186
Binary files /dev/null and b/tests/f_uninit_restart_fsck/image.gz differ
diff --git a/tests/f_uninit_restart_fsck/name b/tests/f_uninit_restart_fsck/name
new file mode 100644 (file)
index 0000000..def2234
--- /dev/null
@@ -0,0 +1 @@
+re-start e2fsck only once for inodes in uninit space
diff --git a/tests/f_uninit_set_inode_not_set/expect.1 b/tests/f_uninit_set_inode_not_set/expect.1
new file mode 100644 (file)
index 0000000..4ea3f10
--- /dev/null
@@ -0,0 +1,25 @@
+Group descriptor 1 has invalid unused inodes count 1464.  Fix? yes
+
+Group descriptor 2 has invalid unused inodes count 1849.  Fix? yes
+
+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
+Group 1 block(s) in use but group is marked BLOCK_UNINIT
+Fix? yes
+
+Block bitmap differences:  +(9729--14621)
+Fix? yes
+
+Free inodes count wrong for group #1 (0, counted=1464).
+Fix? yes
+
+Free inodes count wrong for group #2 (0, counted=1849).
+Fix? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 794/8192 files (0.3% non-contiguous), 8473/32768 blocks
+Exit status is 1
diff --git a/tests/f_uninit_set_inode_not_set/expect.2 b/tests/f_uninit_set_inode_not_set/expect.2
new file mode 100644 (file)
index 0000000..846c558
--- /dev/null
@@ -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: 794/8192 files (0.3% non-contiguous), 8473/32768 blocks
+Exit status is 0
diff --git a/tests/f_uninit_set_inode_not_set/image.gz b/tests/f_uninit_set_inode_not_set/image.gz
new file mode 100644 (file)
index 0000000..cd38e27
Binary files /dev/null and b/tests/f_uninit_set_inode_not_set/image.gz differ
diff --git a/tests/f_uninit_set_inode_not_set/name b/tests/f_uninit_set_inode_not_set/name
new file mode 100644 (file)
index 0000000..42b9c53
--- /dev/null
@@ -0,0 +1 @@
+block uninit set but inode uninit not set