Page MenuHomeFreeBSD

Do not read the on-disk inode in case of vnode allocation.
ClosedPublic

Authored by fsu on Feb 24 2019, 1:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 6 2025, 3:42 AM
Unknown Object (File)
Jan 21 2025, 8:44 AM
Unknown Object (File)
Jan 19 2025, 7:58 AM
Unknown Object (File)
Jan 19 2025, 12:13 AM
Unknown Object (File)
Jan 17 2025, 6:30 PM
Unknown Object (File)
Jan 15 2025, 4:21 PM
Unknown Object (File)
Jan 14 2025, 6:00 AM
Unknown Object (File)
Dec 11 2024, 1:12 PM
Subscribers

Details

Test Plan

Typical fsx/fstorture tests to avoid regression.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Note why we specifically set ip->i_flags = 0 since r294652:

ext2: Initialize i_flag after allocation.

We use i_flag to carry some flags like IN_E4INDEX which newer
ext2fs variants uses internally.

fsck.ext3 rightfully complains after our implementation tags
non-directory inodes with INDEX_FL.

Initializing i_flag during allocation removes the noise factor
and quiets down fsck.

In D19327#413791, @pfg wrote:

Note why we specifically set ip->i_flags = 0 since r294652:

The ip->i_flags will be zero in all cases inside this function because we does not read new inode from disk at all for now and inode is allocated thru malloc with M_ZERO flag.

ext2: Initialize i_flag after allocation.

We use i_flag to carry some flags like IN_E4INDEX which newer
ext2fs variants uses internally.

fsck.ext3 rightfully complains after our implementation tags
non-directory inodes with INDEX_FL.

I think it was saved to disk by ext2fs somehow, and than fsck reported errors.
But, I checked it in the code and cannot understand how it could happen.
If I will reproduce this issue, it will be fixed immediately.

Initializing i_flag during allocation removes the noise factor
and quiets down fsck.

In D19327#414960, @fsu wrote:
In D19327#413791, @pfg wrote:

Note why we specifically set ip->i_flags = 0 since r294652:

The ip->i_flags will be zero in all cases inside this function because we does not read new inode from disk at all for now and inode is allocated thru malloc with M_ZERO flag.

OK, you are rught, we were not allocating (with M_ZERO) this before.

This revision is now accepted and ready to land.Feb 27 2019, 4:51 PM
This revision was automatically updated to reflect the committed changes.