Page MenuHomeFreeBSD

Fix inode birthtime updating.
ClosedPublic

Authored by fsu on Apr 22 2021, 5:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 10, 11:15 PM
Unknown Object (File)
Thu, May 9, 7:47 PM
Unknown Object (File)
Wed, May 1, 7:03 PM
Unknown Object (File)
Sat, Apr 27, 4:12 AM
Unknown Object (File)
Fri, Apr 26, 4:40 PM
Unknown Object (File)
Thu, Apr 25, 5:09 PM
Unknown Object (File)
Sat, Apr 20, 1:04 AM
Unknown Object (File)
Thu, Apr 18, 2:54 PM
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 Skipped
Unit
Tests Skipped

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

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.