Page MenuHomeFreeBSD

Don't terminate when statfs() fails.
ClosedPublic

Authored by delphij on Nov 10 2017, 8:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 28 2024, 10:31 AM
Unknown Object (File)
Dec 20 2023, 3:51 AM
Unknown Object (File)
May 14 2023, 6:15 AM
Unknown Object (File)
Apr 25 2023, 9:24 AM
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.