Page MenuHomeFreeBSD

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

Authored by cem on Sep 5 2018, 1:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 7:51 PM
Unknown Object (File)
Fri, Mar 22, 7:51 PM
Unknown Object (File)
Fri, Mar 22, 10:32 AM
Unknown Object (File)
Fri, Mar 22, 10:02 AM
Unknown Object (File)
Fri, Mar 22, 9:43 AM
Unknown Object (File)
Fri, Mar 8, 12:44 PM
Unknown Object (File)
Jan 3 2024, 1:29 AM
Unknown Object (File)
Jan 3 2024, 1:29 AM
Subscribers

Details

Summary

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

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

Event Timeline

markj added inline comments.
sbin/mdmfs/mdmfs.c
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.

Thanks!

Removed extraneous comma, 'else's per feedback

This revision now requires review to proceed.Sep 5 2018, 2:08 AM
sbin/mdmfs/mdmfs.c
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 ?

sbin/mdmfs/mdmfs.c
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.