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 --- libglusterfs/src/gidcache.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src/gidcache.h') diff --git a/libglusterfs/src/gidcache.h b/libglusterfs/src/gidcache.h index 9379f8e8b..886721e71 100644 --- a/libglusterfs/src/gidcache.h +++ b/libglusterfs/src/gidcache.h @@ -32,6 +32,8 @@ typedef struct { uint64_t gl_id; + uint64_t gl_uid; + uint64_t gl_gid; int gl_count; gid_t *gl_list; time_t gl_deadline; @@ -46,7 +48,7 @@ typedef struct { int gid_cache_init(gid_cache_t *, uint32_t); int gid_cache_reconf(gid_cache_t *, uint32_t); -const gid_list_t *gid_cache_lookup(gid_cache_t *, uint64_t); +const gid_list_t *gid_cache_lookup(gid_cache_t *, uint64_t, uint64_t, uint64_t); void gid_cache_release(gid_cache_t *, const gid_list_t *); int gid_cache_add(gid_cache_t *, gid_list_t *); -- cgit