Page MenuHomeFreeBSD

copy_file_range: Call vn_rdwr() even for zero-length files
ClosedPublic

Authored by markj on Jan 20 2024, 5:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 12:13 AM
Unknown Object (File)
Sun, Nov 10, 10:01 PM
Unknown Object (File)
Sun, Nov 10, 3:22 AM
Unknown Object (File)
Sun, Nov 10, 2:41 AM
Unknown Object (File)
Sat, Nov 9, 7:40 PM
Unknown Object (File)
Sat, Nov 9, 2:12 PM
Unknown Object (File)
Fri, Nov 8, 11:00 PM
Unknown Object (File)
Fri, Nov 8, 4:54 PM
Subscribers

Details

Summary

This ensures that we invoke VOP_READ on the input file even if it's
empty, which in turn helps ensure that filesystems update the atime of
the file.

PR: 274615

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 55512
Build 52401: arc lint + arc unit

Event Timeline

markj requested review of this revision.Jan 20 2024, 5:29 PM
This revision is now accepted and ready to land.Jan 20 2024, 6:45 PM

Needs rebasing but passes the additional test from D44609.

sys/kern/vfs_vnops.c
3573

Instead of adding a flag, you could simply switch from while to do-while.

sys/kern/vfs_vnops.c
3573

It's not that simple - we could have interrupted != 0 before the first iteration.

This revision was automatically updated to reflect the committed changes.