glusterfs/0547-perf-write-behind-Clear-frame-local-on-conflict-erro.patch
Gluster Jenkins af562eab56 autobuild v6.0-57
Related: rhbz#2055630
Resolves: bz#1600379 bz#1689375 bz#1782428 bz#1798897 bz#1815462
Resolves: bz#1889966 bz#1891403 bz#1901468 bz#1903911 bz#1908635
Resolves: bz#1917488 bz#1918018 bz#1919132 bz#1925425 bz#1927411
Resolves: bz#1927640 bz#1928676 bz#1942816 bz#1943467 bz#1945143
Resolves: bz#1946171 bz#1957191 bz#1957641
Signed-off-by: Gluster Jenkins <dkhandel+glusterjenkins@redhat.com>
2022-02-28 21:15:34 +02:00

48 lines
1.8 KiB
Diff

From 08c57926118b1ab8fa1fcd5b16913ff22d97d065 Mon Sep 17 00:00:00 2001
From: N Balachandran <nbalacha@redhat.com>
Date: Wed, 25 Sep 2019 19:50:27 +0530
Subject: [PATCH 547/584] perf/write-behind: Clear frame->local on conflict
error
WB saves the wb_inode in frame->local for the truncate and
ftruncate fops. This value is not cleared in case of error
on a conflicting write request. FRAME_DESTROY finds a non-null
frame->local and tries to free it using mem_put. However,
wb_inode is allocated using GF_CALLOC, causing the
process to crash.
credit: vpolakis@gmail.com
Upstream Patch: https://review.gluster.org/#/c/glusterfs/+/23485/
>Change-Id: I217f61470445775e05145aebe44c814731c1b8c5
>Fixes: bz#1753592
>Signed-off-by: N Balachandran <nbalacha@redhat.com>
BUG: 1917488
Change-Id: I217f61470445775e05145aebe44c814731c1b8c5
Signed-off-by: Sunil Kumar H G <sheggodu@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/c/rhs-glusterfs/+/244277
Tested-by: RHGS Build Bot <nigelb@redhat.com>
---
xlators/performance/write-behind/src/write-behind.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index 90a0bcf..31ab723 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1523,6 +1523,10 @@ __wb_handle_failed_conflict(wb_request_t *req, wb_request_t *conflict,
*/
req->op_ret = -1;
req->op_errno = conflict->op_errno;
+ if ((req->stub->fop == GF_FOP_TRUNCATE) ||
+ (req->stub->fop == GF_FOP_FTRUNCATE)) {
+ req->stub->frame->local = NULL;
+ }
list_del_init(&req->todo);
list_add_tail(&req->winds, tasks);
--
1.8.3.1