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)
Sun, Apr 14, 9:11 PM
Unknown Object (File)
Sun, Apr 14, 9:07 PM
Unknown Object (File)
Mar 22 2024, 7:51 PM
Unknown Object (File)
Mar 22 2024, 7:51 PM
Unknown Object (File)
Mar 22 2024, 10:32 AM
Unknown Object (File)
Mar 22 2024, 10:02 AM
Unknown Object (File)
Mar 22 2024, 9:43 AM
Unknown Object (File)
Mar 8 2024, 12:44 PM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19401
Build 19001: arc lint + arc unit

Event Timeline

markj added inline comments.
sbin/mdmfs/mdmfs.c
680

The comma isn't needed.

780

"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

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

*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.