summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.h
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-05-02 23:36:01 -0700
committerVijay Bellur <vbellur@redhat.com>2013-07-24 11:36:46 -0700
commit7cfef511898ba2d555256e6d7f53bd97ed69e6e0 (patch)
treea138a2c0eb439610ca87f35607b1fae90e68829d /libglusterfs/src/syncop.h
parente45e0037f6df6a0fab846a83fb2c99bb09417cf4 (diff)
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 <avati@redhat.com> Reviewed-on: http://review.gluster.org/5111 Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/syncop.h')
-rw-r--r--libglusterfs/src/syncop.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h
index 43e71c4f6f8..c4b339ee7ba 100644
--- a/libglusterfs/src/syncop.h
+++ b/libglusterfs/src/syncop.h
@@ -240,6 +240,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)
@@ -248,7 +249,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;
}