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
F103225789: D2351.diff
Fri, Nov 22, 10:10 AM
Unknown Object (File)
Mon, Nov 4, 7:25 AM
Unknown Object (File)
Mon, Nov 4, 7:25 AM
Unknown Object (File)
Mon, Nov 4, 7:06 AM
Unknown Object (File)
Oct 4 2024, 7:39 AM
Unknown Object (File)
Sep 30 2024, 9:13 AM
Unknown Object (File)
Sep 23 2024, 2:58 PM
Unknown Object (File)
Aug 31 2024, 11:59 AM
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!