When new directory is created and initialized (see ext4_link() and ext4_trunc_dir()), the csum is calculated before the inode is set to 0 and results in corrupt checksum. This affects only empty directories because as soon as new entries get added to a directory, the csum gets updated to new correct value.
This PR moves the setting of the inode before calculating the csum.
When new directory is created and initialized (see
ext4_link()
andext4_trunc_dir()
), thecsum
is calculated before the inode is set to 0 and results in corrupt checksum. This affects only empty directories because as soon as new entries get added to a directory, thecsum
gets updated to new correct value.This PR moves the setting of the inode before calculating the
csum
.