Page MenuHomeFreeBSD

Handle truncation while processing a file
ClosedPublic

Authored by darius-dons.net.au on Apr 23 2015, 3:05 AM.
Tags
None
Referenced Files
F80131957: D2351.diff
Thu, Mar 28, 8:19 AM
Unknown Object (File)
Jan 7 2024, 8:15 PM
Unknown Object (File)
Dec 20 2023, 12:50 AM
Unknown Object (File)
Dec 2 2023, 3:13 AM
Unknown Object (File)
Nov 13 2023, 11:26 AM
Unknown Object (File)
Oct 30 2023, 12:47 AM
Unknown Object (File)
Oct 25 2023, 5:48 AM
Unknown Object (File)
Aug 17 2023, 12:22 PM
Subscribers

Details

Reviewers
ngie
delphij
Group Reviewers
security
Summary

If the file is truncated during processing the loop will spin forever.

See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196694

Test Plan

I put a break point in the loop and truncated the file, previously it would spin forever, with the change it doesn't.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

darius-dons.net.au retitled this revision from to Handle truncation while processing a file.
darius-dons.net.au updated this object.
darius-dons.net.au edited the test plan for this revision. (Show Details)
darius-dons.net.au added a reviewer: ngie.
darius-dons.net.au set the repository for this revision to rS FreeBSD src repository - subversion.
ngie edited edge metadata.

Based on internal testing done and the fact that this change is shipping in current versions of OneFS, I say, ShipIt!

This revision is now accepted and ready to land.Apr 23 2015, 3:37 AM
delphij added a reviewer: delphij.
delphij added a subscriber: delphij.

Looks good to me, the code should take read(2) returning 0 as a signal for breaking the loop.

Committed as r281928 -- thank you!