Page MenuHomeFreeBSD

Fix inode birthtime updating.
ClosedPublic

Authored by fsu on Apr 22 2021, 5:25 PM.
Tags
None
Referenced Files
F81590474: D29929.id88772.diff
Thu, Apr 18, 2:54 PM
Unknown Object (File)
Tue, Apr 16, 11:27 AM
Unknown Object (File)
Feb 10 2024, 5:02 PM
Unknown Object (File)
Jan 17 2024, 9:10 PM
Unknown Object (File)
Jan 15 2024, 3:13 AM
Unknown Object (File)
Jan 14 2024, 4:58 AM
Unknown Object (File)
Dec 31 2023, 10:51 AM
Unknown Object (File)
Dec 19 2023, 10:52 AM
Subscribers
None

Details

Summary

The birthtime field of struct vattr does not checked for VNOVAL in case of ext2_setattr() and produce incorrect inode birthtime values.

Test Plan

Found using pjdfstest: pjdfstest/tests/utimensat/03.t.
Testcase passed after fix.

Diff Detail

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

Event Timeline

fsu requested review of this revision.Apr 22 2021, 5:25 PM
fsu created this revision.

Minor knits, otherwise LGTM.

sys/fs/ext2fs/ext2_vnops.c
380

Not needed because the macro has parenthesis already (standard practice).

509–512

Invert the order: whe should verify if E2DI_AS_XTIME first and only then check for VNOVAL.

This revision is now accepted and ready to land.Apr 22 2021, 8:05 PM

Fix and expression order.

This revision now requires review to proceed.Apr 23 2021, 2:32 PM
sys/fs/ext2fs/ext2_vnops.c
380

May be let's leave it as is. The concern is, that if expression without braces looks strange. Also, we have same if expressions with braces in the ext2_inode_cnv.c.

This revision is now accepted and ready to land.Apr 23 2021, 4:04 PM
This revision was automatically updated to reflect the committed changes.
fsu marked an inline comment as not done.