From 26c1d15b4113b37eda67ba53b52c7f7d05c01042 Mon Sep 17 00:00:00 2001
From: ericm <ericm>
Date: Wed, 27 Apr 2005 10:59:28 +0000
Subject: [PATCH] b=5538 by Nikita: fix group_info reference leak in
 pack_secdesc().

---
 lustre/ptlrpc/pack_generic.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c
index 5d4fbb9e64..1016882100 100644
--- a/lustre/ptlrpc/pack_generic.c
+++ b/lustre/ptlrpc/pack_generic.c
@@ -97,10 +97,6 @@ void lustre_pack_secdesc(struct ptlrpc_request *req, int size)
 {
 #ifdef __KERNEL__
         struct mds_req_sec_desc *rsd;
-        
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
-        struct group_info *ginfo;
-#endif
 
         rsd = lustre_msg_buf(req->rq_reqmsg,
                              MDS_REQ_SECDESC_OFF, size);
@@ -115,13 +111,11 @@ void lustre_pack_secdesc(struct ptlrpc_request *req, int size)
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
         task_lock(current);
-        get_group_info(current->group_info);
-        ginfo = current->group_info;
-        task_unlock(current);
-        if (rsd->rsd_ngroups > ginfo->ngroups)
-                rsd->rsd_ngroups = ginfo->ngroups;
-        memcpy(rsd->rsd_groups, ginfo->blocks[0],
+        if (rsd->rsd_ngroups > current->group_info->ngroups)
+                rsd->rsd_ngroups = current->group_info->ngroups;
+        memcpy(rsd->rsd_groups, current->group_info->blocks[0],
                rsd->rsd_ngroups * sizeof(__u32));
+        task_unlock(current);
 #else
         LASSERT(rsd->rsd_ngroups <= NGROUPS);
         if (rsd->rsd_ngroups > current->ngroups)
-- 
GitLab