Page MenuHomeFreeBSD

mdmfs(8): Check for other types of helper-program failure

Authored by cem on Sep 5 2018, 1:49 AM.



Exiting with a signal should not be treated the same as successful exit with
zero status.

Return signal exit information to the callers via negative integers, to
enable distinction from normal exit statuses. (All consumers that check for
errors don't care what the exact non-zero exit value is -- in such a case
they print a diagnostic message and either continue or bail.)

Additionally, check for unexpected sources of waitpid() wakeup and bail if
we encounter them.

Reported by: lev@

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj added inline comments.
680 ↗(On Diff #47677)

The comma isn't needed.

780 ↗(On Diff #47677)

"else" is redundant here. Ditto below.

This revision is now accepted and ready to land.Sep 5 2018, 1:54 AM
cem marked 2 inline comments as done.


Removed extraneous comma, 'else's per feedback

This revision now requires review to proceed.Sep 5 2018, 2:08 AM
434 ↗(On Diff #47680)

It is impossible to understand what is going on seeing an error like

mdconfig exited with error code -9

I think it would be much more useful to check for the negative error and change the message to note a signal.

Same for other run() invocations. Perhaps add a helper ?

434 ↗(On Diff #47680)

*Shrug* Ok

Decode signal return codes from run() more nicely in printed errors.

cem marked 2 inline comments as done.Sep 5 2018, 3:05 PM

Looks good.
Thank you!

This revision is now accepted and ready to land.Sep 6 2018, 12:56 PM
This revision was automatically updated to reflect the committed changes.