Page MenuHomeFreeBSD

Fix inode birthtime updating.
ClosedPublic

Authored by fsu on Apr 22 2021, 5:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 9, 5:50 PM
Unknown Object (File)
Thu, Dec 7, 5:39 PM
Unknown Object (File)
Tue, Dec 5, 6:02 PM
Unknown Object (File)
Fri, Dec 1, 7:16 PM
Unknown Object (File)
Oct 13 2023, 4:51 AM
Unknown Object (File)
Oct 12 2023, 2:49 AM
Unknown Object (File)
Sep 16 2023, 11:33 AM
Unknown Object (File)
Sep 6 2023, 2:31 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.