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)
Mar 6 2024, 1:05 AM
Unknown Object (File)
Feb 18 2024, 10:50 AM
Unknown Object (File)
Jan 15 2024, 9:29 AM
Unknown Object (File)
Jan 13 2024, 11:22 AM
Unknown Object (File)
Jan 6 2024, 3:56 AM
Unknown Object (File)
Dec 24 2023, 12:11 AM
Unknown Object (File)
Dec 22 2023, 10:07 PM
Unknown Object (File)
Nov 26 2023, 9:33 AM
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.