Page MenuHomeFreeBSD

Don't terminate when statfs() fails.
ClosedPublic

Authored by delphij on Nov 10 2017, 8:03 AM.
Tags
None
Referenced Files
F106169240: D13024.id35082.diff
Thu, Dec 26, 12:54 PM
F106141167: D13024.diff
Thu, Dec 26, 2:05 AM
Unknown Object (File)
Nov 7 2024, 4:21 PM
Unknown Object (File)
Sep 22 2024, 11:44 PM
Unknown Object (File)
Sep 22 2024, 9:17 PM
Unknown Object (File)
Sep 22 2024, 11:24 AM
Unknown Object (File)
Sep 9 2024, 3:21 AM
Unknown Object (File)
Sep 8 2024, 8:31 PM
Subscribers

Details

Summary

Current code terminates when statfs() fails, in -fstype
primary, which can happen when a directory is removed in the middle
of find.

Instead of a full err(), treat this as an error that can continue
by returning 0.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Nov 10 2017, 2:01 PM
jilles requested changes to this revision.Nov 10 2017, 8:54 PM

Hmm, looking again, the idea of continuing is good, but printing diagnostics without affecting the exit status is usually not POSIX-compliant. To fix this, the global variable exitstatus can be set to 1. Note that there are existing places in function.c that do this wrong (which need not be fixed for this review).

Also, if the error is ENOENT and the global variable ignore_readdir_race is set, both diagnostic and exit status change need not happen.

This revision now requires changes to proceed.Nov 10 2017, 8:54 PM

Address jilles's comments.

This revision is now accepted and ready to land.Nov 11 2017, 6:46 PM
This revision was automatically updated to reflect the committed changes.