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