Page MenuHomeFreeBSD

VOP_STAT: Provide a default value for va_gen
ClosedPublic

Authored by markj on May 3 2021, 1:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 7:00 PM
Unknown Object (File)
Feb 20 2024, 2:54 AM
Unknown Object (File)
Feb 13 2024, 12:30 AM
Unknown Object (File)
Feb 6 2024, 10:16 AM
Unknown Object (File)
Dec 23 2023, 1:55 AM
Unknown Object (File)
Dec 14 2023, 8:32 PM
Unknown Object (File)
Oct 16 2023, 8:51 AM
Unknown Object (File)
Oct 13 2023, 5:06 PM
Subscribers

Details

Summary

Some filesystems, e.g., pseudofs and the NFSv3 client, do not provide
one.

Reported by: KMSAN

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.May 3 2021, 1:33 PM
sys/kern/vfs_default.c
1503

I believe that it is better to initialize the field with VNOVAL AKA -1.

For instance, UFS *set*attr compares va_gen with VNOVAL.

sys/kern/vfs_default.c
1503

I note that quite a few filesystems individually initialize va_gen as 0 in their getattr implementations. Should they be left alone?

kib added inline comments.
sys/kern/vfs_default.c
1503

Hm, UFS interprets 0 as not having i_gen initialized, not VNOVAL. See ffs_vfsops.c:ffs_vgetf().

So now I think that my suggestion is wrong, and VNOVAL is the valid value for va_gen e.g. from UFS.

This revision is now accepted and ready to land.May 3 2021, 3:14 PM
This revision was automatically updated to reflect the committed changes.