Whamcloud - gitweb
tests: new test to check quota after a bad inode deallocation
authorLuis Henriques (SUSE) <luis.henriques@linux.dev>
Fri, 5 Apr 2024 14:24:05 +0000 (15:24 +0100)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 16 Apr 2024 03:59:35 +0000 (23:59 -0400)
This new test validates e2fsck by verifying that quota is updated after a bad
inode is deallocated.  It mimics fstest ext4/019 by including a filesystem image
where a symbolic link was created to an existing file, using a long symlink
name.  This symbolic link was then wiped with:

  # debugfs -w -R 'zap -f /testlink 0' f_testnew/image

Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20240405142405.12312-5-luis.henriques@linux.dev
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/f_quota_deallocate_inode/expect.1 [new file with mode: 0644]
tests/f_quota_deallocate_inode/expect.2 [new file with mode: 0644]
tests/f_quota_deallocate_inode/image.gz [new file with mode: 0644]
tests/f_quota_deallocate_inode/name [new file with mode: 0644]

diff --git a/tests/f_quota_deallocate_inode/expect.1 b/tests/f_quota_deallocate_inode/expect.1
new file mode 100644 (file)
index 0000000..2b2f128
--- /dev/null
@@ -0,0 +1,18 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Symlink /testlink (inode #14) is invalid.
+Clear? yes
+
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 4) != expected (16384, 5)
+Update quota info for quota type 0? yes
+
+[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 4) != expected (16384, 5)
+Update quota info for quota type 1? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 13/256 files (15.4% non-contiguous), 1157/8192 blocks
+Exit status is 1
diff --git a/tests/f_quota_deallocate_inode/expect.2 b/tests/f_quota_deallocate_inode/expect.2
new file mode 100644 (file)
index 0000000..8023179
--- /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/256 files (15.4% non-contiguous), 1157/8192 blocks
+Exit status is 0
diff --git a/tests/f_quota_deallocate_inode/image.gz b/tests/f_quota_deallocate_inode/image.gz
new file mode 100644 (file)
index 0000000..798a72c
Binary files /dev/null and b/tests/f_quota_deallocate_inode/image.gz differ
diff --git a/tests/f_quota_deallocate_inode/name b/tests/f_quota_deallocate_inode/name
new file mode 100644 (file)
index 0000000..396887c
--- /dev/null
@@ -0,0 +1 @@
+update quota when deallocating bad inode