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