f338ef
From 1aa175f353325775517daf1d48a19799e0cafc7a Mon Sep 17 00:00:00 2001
f338ef
From: Pranith Kumar K <pkarampu@redhat.com>
f338ef
Date: Mon, 22 Jul 2019 20:55:33 +0530
f338ef
Subject: [PATCH 261/261] features/utime: Fix mem_put crash
f338ef
f338ef
Problem:
f338ef
When frame->local is not null FRAME_DESTROY calls mem_put on it.
f338ef
Since the stub is already destroyed in call_resume(), it leads
f338ef
to crash
f338ef
f338ef
Fix:
f338ef
Set frame->local to NULL before calling call_resume()
f338ef
f338ef
Backport of:
f338ef
 > Patch: https://review.gluster.org/23091
f338ef
 > fixes: bz#1593542
f338ef
 > Change-Id: I0f8adf406f4cefdb89d7624ba7a9d9c2eedfb1de
f338ef
 > Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
f338ef
f338ef
BUG: 1715422
f338ef
Change-Id: I0f8adf406f4cefdb89d7624ba7a9d9c2eedfb1de
f338ef
Signed-off-by: Kotresh HR <khiremat@redhat.com>
f338ef
Reviewed-on: https://code.engineering.redhat.com/gerrit/176726
f338ef
Tested-by: RHGS Build Bot <nigelb@redhat.com>
f338ef
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
f338ef
---
f338ef
 xlators/features/utime/src/utime.c | 4 +++-
f338ef
 1 file changed, 3 insertions(+), 1 deletion(-)
f338ef
f338ef
diff --git a/xlators/features/utime/src/utime.c b/xlators/features/utime/src/utime.c
f338ef
index 2a986e7..e3a80b6 100644
f338ef
--- a/xlators/features/utime/src/utime.c
f338ef
+++ b/xlators/features/utime/src/utime.c
f338ef
@@ -139,12 +139,14 @@ gf_utime_set_mdata_setxattr_cbk(call_frame_t *frame, void *cookie,
f338ef
                                 xlator_t *this, int op_ret, int op_errno,
f338ef
                                 dict_t *xdata)
f338ef
 {
f338ef
+    call_stub_t *stub = frame->local;
f338ef
     /* Don't fail lookup if mdata setxattr fails */
f338ef
     if (op_ret) {
f338ef
         gf_msg(this->name, GF_LOG_ERROR, op_errno, UTIME_MSG_SET_MDATA_FAILED,
f338ef
                "dict set of key for set-ctime-mdata failed");
f338ef
     }
f338ef
-    call_resume(frame->local);
f338ef
+    frame->local = NULL;
f338ef
+    call_resume(stub);
f338ef
     return 0;
f338ef
 }
f338ef
 
f338ef
-- 
f338ef
1.8.3.1
f338ef