summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2017-02-22 14:02:43 -0500
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-23 14:15:22 -0500
commitd2a3a8f520068dc4e3cb49e2fa49afddb7c5dec7 (patch)
tree7ced3fd4021e5eb41995a59cb7e10a538c021dfb
parent24eed72f7359db33df9fe4b02fe3f2d3ce4a5665 (diff)
gfapi: OBS build fails in post build analysisv3.10.0
Originally gfapi: create statedump when glusterd requests it When GlusterD sends the STATEDUMP procedure to the libgfapi client, the client checks if it matches the PID that should take the statedump. If so, it will do a statedump for the glfs_t that is connected to this mgmt connection. See https://bugzilla.redhat.com/show_bug.cgi?id=1169302#c25 for the OpenSuSE Build System post build analysis error. original Change-Id: I70d6a1f4f19d525377aebc8fa57f51e513b92d84 master https://review.gluster.org/#/c/16415/ release-3.10 https://review.gluster.org/#/c/16602/ BUG: 1418981 Change-Id: I1cff59ed34ac963334416d4271f7a187cd88bff6 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: https://review.gluster.org/16723 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r--api/src/glfs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index 4aa9711..d19effb 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -1471,6 +1471,8 @@ pub_glfs_sysrq (struct glfs *fs, char sysrq)
{
glusterfs_ctx_t *ctx = NULL;
int ret = 0;
+ char msg[1024] = {0,}; /* should not exceed 1024 chars */
+ size_t rem = sizeof (msg);
if (!fs || !fs->ctx) {
ret = -1;
@@ -1483,13 +1485,12 @@ pub_glfs_sysrq (struct glfs *fs, char sysrq)
switch (sysrq) {
case GLFS_SYSRQ_HELP:
{
- char msg[1024]; /* help text should not exceed 1024 chars */
struct glfs_sysrq_help *usage;
- msg[0] = '\0';
for (usage = glfs_sysrq_help; usage->sysrq; usage++) {
- strncat (msg, usage->msg, 1024);
- strncat (msg, " ", 1024);
+ strncat (msg, usage->msg, rem);
+ rem -= strlen (usage->msg);
+ strncat (msg, " ", rem--);
}
/* not really an 'error', but make sure it gets logged */