selftests/mount_settattr: ensure that ext4 filesystem can be created
authorChristian Brauner <brauner@kernel.org>
Wed, 9 Apr 2025 11:00:21 +0000 (13:00 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 12 May 2025 09:40:08 +0000 (11:40 +0200)
Filesystem too small for a journal
mount: /mnt/D/: mount failed: Operation not permitted.
mount_setattr_test.c:1076:idmap_mount_tree_invalid:Expected system("mount -o loop -t ext4 /mnt/C/ext4.img /mnt/D/") (256) == 0 (0)

Signed-off-by: Christian Brauner <brauner@kernel.org>
tools/testing/selftests/mount_setattr/mount_setattr_test.c

index eaa4e91..432d9af 100644 (file)
@@ -1071,7 +1071,7 @@ FIXTURE_SETUP(mount_setattr_idmapped)
        ASSERT_EQ(mkdir("/mnt/D", 0777), 0);
        img_fd = openat(-EBADF, "/mnt/C/ext4.img", O_CREAT | O_WRONLY, 0600);
        ASSERT_GE(img_fd, 0);
-       ASSERT_EQ(ftruncate(img_fd, 1024 * 2048), 0);
+       ASSERT_EQ(ftruncate(img_fd, 2147483648 /* 2 GB */), 0);
        ASSERT_EQ(system("mkfs.ext4 -q /mnt/C/ext4.img"), 0);
        ASSERT_EQ(system("mount -o loop -t ext4 /mnt/C/ext4.img /mnt/D/"), 0);
        ASSERT_EQ(close(img_fd), 0);