From e3464df47b2e83ee160362a897adc1191a922ce9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 4 Apr 2019 14:51:21 -0500 Subject: [PATCH] global/signal_handler: avoid core dump on EIO Generating a core dump is overkill if we hit an EIO error from the hardware. Exit with an error code instead. Signed-off-by: Sage Weil --- src/global/signal_handler.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/global/signal_handler.cc b/src/global/signal_handler.cc index 91be152f2b8..56a586d7f01 100644 --- a/src/global/signal_handler.cc +++ b/src/global/signal_handler.cc @@ -318,7 +318,13 @@ static void handle_fatal_signal(int signum) } } - reraise_fatal(signum); + if (g_eio) { + // if this was an EIO crash, we don't need to trigger a core dump, + // since the problem is hardware, or some layer beneath us. + _exit(EIO); + } else { + reraise_fatal(signum); + } } void install_standard_sighandlers(void) -- 2.39.5