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)
Sun, Jul 27, 1:44 AM
Unknown Object (File)
Jun 27 2025, 1:22 PM
Unknown Object (File)
Jun 23 2025, 6:44 PM
Unknown Object (File)
Jun 13 2025, 12:59 PM
Unknown Object (File)
Jun 12 2025, 12:59 PM
Unknown Object (File)
Jun 3 2025, 9:52 AM
Unknown Object (File)
May 31 2025, 9:29 PM
Unknown Object (File)
May 31 2025, 5:12 AM
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 Not Applicable
Unit
Tests Not Applicable

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
3592

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

sys/kern/vfs_vnops.c
3592

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

This revision was automatically updated to reflect the committed changes.