From 2d86bd1e70106afaff5200ba819303b16c2e587d Mon Sep 17 00:00:00 2001 From: nasf Date: Wed, 17 Aug 2011 15:18:34 +0800 Subject: [PATCH] LU-599 verify "mi_ginfo" before accessing its member 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 Reviewed-on: http://review.whamcloud.com/1252 Tested-by: Hudson Reviewed-by: Yu Jian Reviewed-by: hongchao.zhang Tested-by: hongchao.zhang Tested-by: Yu Jian Reviewed-by: Oleg Drokin --- lustre/mdt/mdt_identity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/mdt/mdt_identity.c b/lustre/mdt/mdt_identity.c index 6590e4e..59a5535 100644 --- a/lustre/mdt/mdt_identity.c +++ b/lustre/mdt/mdt_identity.c @@ -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); } -- 1.8.3.1