Blob Blame History Raw
From 112a51cb634691c8db0f1a4da0228639102755da Mon Sep 17 00:00:00 2001
From: Jiffin Tony Thottan <jthottan@redhat.com>
Date: Mon, 30 May 2016 17:39:02 +0530
Subject: [PATCH 176/178] Revert "gfapi/upcall: Use GF_CALLOC while allocating variables"

The above fix cause another regression for ganesha mount.
The struct which allocated here is a generic structure used by
both gfapi and FSAL_GLUSTER. So allocating it using GF_CALLOC()
is wrong to do. Therefore release that variable using "free()"
instead of GF_FREE()

So reverting that change and fix the same in another way.

This reverts commit 60089f6e16afe6760e0db536086cea5c9ddb5b43.

Please Note :
This is a hacky fix, so patch is sent only to downstream.
Clean fix requires changes in both ganesha and gfapi codes,
with in current time constraint which is difficult to achieve.

Please refer following ML for more details
http://post-office.corp.redhat.com/archives/nfs-ganesha/2016-May/msg00116.html

label : DOWNSTREAM ONLY

Change-Id: I9240de5666df339c794466a9aa2acc285c173cf2
BUG: 1339208
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/75429
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Niels de Vos <ndevos@redhat.com>
---
 api/src/glfs-handleops.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 77b8a6a..5fb5b71 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1903,8 +1903,7 @@ glfs_h_poll_cache_invalidation (struct glfs *fs,
                 goto out;
         }
 
-        up_inode_arg = GF_CALLOC (1, sizeof (struct callback_inode_arg),
-                                  glfs_mt_upcall_entry_t);
+        up_inode_arg = calloc (1, sizeof (struct callback_inode_arg));
         GF_VALIDATE_OR_GOTO ("glfs_h_poll_cache_invalidation",
                              up_inode_arg, out);
 
@@ -1970,7 +1969,8 @@ out:
 
                 /* Reset event_arg as well*/
                 up_arg->event_arg = NULL;
-                GF_FREE (up_inode_arg);
+                free (up_inode_arg);
+                up_inode_arg = NULL;
         }
         return ret;
 }
-- 
1.7.1