ext4/033: test EXT4_IOC_RESIZE_FS by calling the ioctl directly
authorTheodore Ts'o <tytso@mit.edu>
Mon, 20 Dec 2021 20:40:59 +0000 (15:40 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sat, 25 Dec 2021 11:04:08 +0000 (19:04 +0800)
commit92b9c0dedace427e5b4d176113f13c83499855cd
treeefca07c230308a3343bdd2c41316df01a4fa271c
parent53628c36629b0b9c2905a3599220d3f9dbc5695f
ext4/033: test EXT4_IOC_RESIZE_FS by calling the ioctl directly

E2fsprogs commits 4ea80d031c7e ("resize2fs: adjust new size of the
file system to allow a successful resize") and 50088b1996cc
("resize2fs: attempt to keep the # of inodes valid by removing the
last bg") will automatically reduce the requested new size of the file
system by up to a single block group to avoid overflowing the 32-bit
inode count.   This interferes with ext4/033's test of kernel commit
4f2f76f75143 ("ext4: Forbid overflowing inode count when # resizing".)

Address this by creating a new test program, ext4_resize which calls
the EXT4_IOC_RESIZE_FS ioctl directly so we can correctly test the
kernel's online resize code.

Reported-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
.gitignore
src/Makefile
src/ext4_resize.c [new file with mode: 0644]
tests/ext4/033