From a4f1f5fcc0dfd533279ad1c41235665af82539d1 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Wed, 26 Oct 2016 16:31:58 +0530 Subject: glusterfsd: Continuous errors are getting in mount logs while glusterd is down Problem: when glusterd is down, getting the continuous mgmt_rpc_notify errors messages in the volume mount log for every 3 seconds,it will consume disk space. Solution: To reduce the frequency of error messages use GF_LOG_OCCASIONALLY. > BUG: 1388877 > Change-Id: I6cf24c6ddd9ab380afd058bc0ecd556d664332b1 > Signed-off-by: Mohit Agrawal > Reviewed-on: http://review.gluster.org/15732 > NetBSD-regression: NetBSD Build System > Smoke: Gluster Build System > CentOS-regression: Gluster Build System > Reviewed-by: Raghavendra Talur > Reviewed-by: Raghavendra G > Reviewed-by: Jeff Darcy > (cherry picked from commit 7874ed245bcc80658547992205f8396f4dd3c76a) Change-Id: I32c7a2271333686b27b43e54a334c58d3da60a1d BUG: 1394108 Signed-off-by: Mohit Agrawal Reviewed-on: http://review.gluster.org/15822 NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Prashanth Pai --- glusterfsd/src/glusterfsd-mgmt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'glusterfsd/src') diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index d8b3ee7d9b3..1336190b5b9 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -1889,6 +1889,8 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, rpc_transport_t *rpc_trans = NULL; int need_term = 0; int emval = 0; + static int log_ctr1; + static int log_ctr2; struct dnscache6 *dnscache = NULL; this = mydata; @@ -1897,7 +1899,7 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, switch (event) { case RPC_CLNT_DISCONNECT: - gf_log ("glusterfsd-mgmt", GF_LOG_ERROR, + GF_LOG_OCCASIONALLY (log_ctr1, "glusterfsd-mgmt", GF_LOG_ERROR, "failed to connect with remote-host: %s (%s)", ctx->cmd_args.volfile_server, strerror (errno)); if (!rpc->disabled) { @@ -1915,8 +1917,9 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event, if (!ctx->active) need_term = 1; emval = ENOTCONN; - gf_log("glusterfsd-mgmt", GF_LOG_INFO, - "Exhausted all volfile servers"); + GF_LOG_OCCASIONALLY (log_ctr2, "glusterfsd-mgmt", + GF_LOG_INFO, + "Exhausted all volfile servers"); break; } server = list_entry (server->list.next, typeof(*server), list); -- cgit From ed3fb30254af39e560d09466c6a755d6e0e4b32d Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Tue, 6 Dec 2016 16:21:41 +0530 Subject: glusterfsd : fix null pointer dereference in glusterfs_handle_barrier >Reviewed-on: http://review.gluster.org/16043 >Smoke: Gluster Build System >CentOS-regression: Gluster Build System >NetBSD-regression: NetBSD Build System >Reviewed-by: Vijay Bellur Change-Id: Iab86a3c4970e54c22d3170e68708e0ea432a8ea4 BUG: 1402697 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/16066 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos --- glusterfsd/src/glusterfsd-mgmt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'glusterfsd/src') diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c index 1336190b5b9..c47fa3883c9 100644 --- a/glusterfsd/src/glusterfsd-mgmt.c +++ b/glusterfsd/src/glusterfsd-mgmt.c @@ -1321,10 +1321,14 @@ glusterfs_handle_barrier (rpcsvc_request_t *req) req->rpc_err = GARBAGE_ARGS; goto out; } + ret = -1; ctx = glusterfsd_ctx; - GF_ASSERT (ctx); + GF_VALIDATE_OR_GOTO (THIS->name, ctx, out); + active = ctx->active; + GF_VALIDATE_OR_GOTO (THIS->name, active, out); + any = active->first; dict = dict_new(); -- cgit