From f6e017cafaaf7d6867da5921dbeec80e4a801fe0 Mon Sep 17 00:00:00 2001 From: Manoj Joseph Date: Mon, 20 Dec 2021 10:30:11 -0800 Subject: [PATCH] DOSE-863 zpool status shows object store error (#76) --- lib/libzutil/zutil_zoa.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/libzutil/zutil_zoa.c b/lib/libzutil/zutil_zoa.c index 181a7e2ad234..8d5e2d1cfab8 100644 --- a/lib/libzutil/zutil_zoa.c +++ b/lib/libzutil/zutil_zoa.c @@ -117,7 +117,16 @@ zoa_connect_agent(libpc_handle_t *hdl, zoa_socket_t zoa_sock) break; } - if (errno == ECONNREFUSED && retries < ZOA_MAX_RETRIES) { + /* + * If the object agent is running or has run in the past, the + * zoa socket file should be present. If this file is missing, + * it indicates that either the agent has never run or the + * superuser removed the file. Fail silently in this case. + */ + if (errno == ENOENT) { + close(sock); + return (-1); + } else if (errno == ECONNREFUSED && retries < ZOA_MAX_RETRIES) { zutil_error(hdl, EZFS_CONNECT_RETRY, dgettext(TEXT_DOMAIN, "failed to connect to object agent process:"));