From fee08b2cbf8c118d33dea745e0ae3033b36969da Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 20 Nov 2013 15:11:13 -0800 Subject: fuse: revalidate group id cache on uid/gid change detection - Remember the uid and gid of the pid at the time of caching the group id list. - Next time when referring to the cache confirm that uid and gid of that pid has not changed since. If it has, treat it like a timeout/cache miss. - Solves group id caching issue caused when Samba runs on gluster FUSE mount and changes the uid/gid on a per syscall basis. Change-Id: I3382b037ff0b6d5eaaa36d9c898232543475aeda BUG: 1032438 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/6320 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/mount/fuse/src/fuse-helpers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/mount/fuse') diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c index 4d478b919..6c54cb882 100644 --- a/xlators/mount/fuse/src/fuse-helpers.c +++ b/xlators/mount/fuse/src/fuse-helpers.c @@ -266,7 +266,8 @@ static void get_groups(fuse_private_t *priv, call_frame_t *frame) return; } - gl = gid_cache_lookup(&priv->gid_cache, frame->root->pid); + gl = gid_cache_lookup(&priv->gid_cache, frame->root->pid, + frame->root->uid, frame->root->gid); if (gl) { if (call_stack_alloc_groups (frame->root, gl->gl_count) != 0) return; @@ -280,6 +281,8 @@ static void get_groups(fuse_private_t *priv, call_frame_t *frame) frame_fill_groups (frame); agl.gl_id = frame->root->pid; + agl.gl_uid = frame->root->uid; + agl.gl_gid = frame->root->gid; agl.gl_count = frame->root->ngrps; agl.gl_list = GF_CALLOC(frame->root->ngrps, sizeof(gid_t), gf_fuse_mt_gids_t); -- cgit