Whamcloud - gitweb
LU-599 verify "mi_ginfo" before accessing its member
authornasf <yong.fan@whamcloud.com>
Wed, 17 Aug 2011 07:18:34 +0000 (15:18 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 18 Aug 2011 20:55:34 +0000 (16:55 -0400)
If the target user only belong to one group, then we just set
"identity->mi_gid", and does not set "identity->mi_ginfo", to
save unnecessary memory allocation and groups processing.

So before accessing member inside "identity->mi_ginfo", make
sure "identity->mi_ginfo" is valid.

Change-Id: I880ccadddd93425c301115328d57c552d11bda8e
Signed-off-by: nasf <yong.fan@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1252
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: hongchao.zhang <hongchao.zhang@whamcloud.com>
Tested-by: hongchao.zhang <hongchao.zhang@whamcloud.com>
Tested-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdt/mdt_identity.c

index 6590e4e..59a5535 100644 (file)
@@ -204,7 +204,7 @@ static int mdt_identity_parse_downcall(struct upcall_cache *cache,
 
         CDEBUG(D_OTHER, "parse mdt identity@%p: %d:%d, ngroups %u, nperms %u\n",
                identity, identity->mi_uid, identity->mi_gid,
-               identity->mi_ginfo->ngroups, identity->mi_nperms);
+               data->idd_ngroups, data->idd_nperms);
 
         RETURN(0);
 }