From: Alexander Aring Date: Mon, 1 Mar 2021 10:16:14 -0500 Subject: [Cluster-devel] [PATCH dlm-tool 2/2] dlm_controld: log receive buffer fail In-Reply-To: <20210301151614.220263-1-aahringo@redhat.com> References: <20210301151614.220263-1-aahringo@redhat.com> Message-ID: <20210301151614.220263-2-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch adds additional handling to log failures of setting receive buffer failures to ensure on debugging if dlm_controld increased the netlink receive buffer size. --- dlm_controld/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dlm_controld/main.c b/dlm_controld/main.c index bcccec4c..2df305bd 100644 --- a/dlm_controld/main.c +++ b/dlm_controld/main.c @@ -765,8 +765,7 @@ static void process_uevent(int ci) static int setup_uevent(void) { struct sockaddr_nl snl; - int rcvbuf; - int s, rv; + int s, rv, val; s = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); if (s < 0) { @@ -788,9 +787,14 @@ static int setup_uevent(void) * receive ENOBUFS but it's more unlikely. May it's worth to handle ENOBUFS * errors on a different way in future. */ - rcvbuf = DEFAULT_NETLINK_RCVBUF; - setsockopt(s, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)); - setsockopt(s, SOL_SOCKET, SO_RCVBUFFORCE, &rcvbuf, sizeof(rcvbuf)); + val = DEFAULT_NETLINK_RCVBUF; + rv = setsockopt(s, SOL_SOCKET, SO_RCVBUF, &val, sizeof(val)); + if (rv == -1) + log_error("uevent netlink SO_RCVBUF errno %d", errno); + + rv = setsockopt(s, SOL_SOCKET, SO_RCVBUFFORCE, &val, sizeof(val)); + if (rv == -1) + log_error("uevent netlink SO_RCVBUFFORCE errno %d", errno); memset(&snl, 0, sizeof(snl)); snl.nl_family = AF_NETLINK; -- 2.26.2