From 8eb866cc0c3ed17f7cd9ca7d6cfc3dc3de140835 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Thu, 2 May 2013 23:36:01 -0700 Subject: core: increase the auxillary group limit to 65536 Make the allocation of groups dynamic and increase the limit to 65536. Change-Id: I702364ff460e3a982e44ccbcb3e337cac9c2df51 BUG: 953694 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/5172 Reviewed-by: Xavier Hernandez Tested-by: Gluster Build System --- libglusterfs/src/syncop.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src/syncop.h') diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 04eb9e5fe8f..d0417b26026 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -239,6 +239,7 @@ static inline call_frame_t * syncop_create_frame (xlator_t *this) { call_frame_t *frame = NULL; + int ngrps = -1; frame = create_frame (this, this->ctx->pool); if (!frame) @@ -247,7 +248,21 @@ syncop_create_frame (xlator_t *this) frame->root->pid = getpid(); frame->root->uid = geteuid (); frame->root->gid = getegid (); - frame->root->ngrps = getgroups (GF_MAX_AUX_GROUPS, frame->root->groups); + ngrps = getgroups (0, 0); + if (ngrps < 0) { + STACK_DESTROY (frame->root); + return NULL; + } + + if (call_stack_alloc_groups (frame->root, ngrps) != 0) { + STACK_DESTROY (frame->root); + return NULL; + } + + if (getgroups (ngrps, frame->root->groups) < 0) { + STACK_DESTROY (frame->root); + return NULL; + } return frame; } -- cgit