]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
libext2fs: don't truncate the orphan file inode if it is newly allocated
authorTheodore Ts'o <tytso@mit.edu>
Fri, 25 Aug 2023 21:28:01 +0000 (17:28 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Aug 2023 21:28:01 +0000 (17:28 -0400)
commit6e776e87051268b7356ad6a244db0a5ac1c10dd5
treee8c1db1dc82a4f9d01de3c05d33601841080ec97
parentfe93a29695f7398046bc9c6aea43ba890687c4c4
libext2fs: don't truncate the orphan file inode if it is newly allocated

In ext2fs_create_orphan_file(), don't try truncating inode for the
orphan file if ext2fs_create_orphan_file() allocated the inode.  This
avoids problems where the newly allocated inode in the inode table
might contain garbage; if the metadata checksum feature is enabled,
this will generally result in the function failing with a checksum
invalid error, but this can cause mke2fs (which calls
ext2fs_create_orphan_file) to fail.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/orphan.c