|
|
14f8ab |
From c429d3c63601e6ea15af76aa684c30bbeb746467 Mon Sep 17 00:00:00 2001
|
|
|
14f8ab |
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
14f8ab |
Date: Tue, 23 Apr 2019 13:03:28 +0530
|
|
|
14f8ab |
Subject: [PATCH 120/124] glusterd/shd: Keep a ref on volinfo until attach rpc
|
|
|
14f8ab |
execute cbk
|
|
|
14f8ab |
|
|
|
14f8ab |
When svc attach execute for multiplexing a daemon, we have to keep
|
|
|
14f8ab |
a ref on volinfo until it finish the execution. Because, if the attach
|
|
|
14f8ab |
is an aysnc call, then a parallel volume delete can lead to free the
|
|
|
14f8ab |
volinfo
|
|
|
14f8ab |
|
|
|
14f8ab |
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22606/
|
|
|
14f8ab |
|
|
|
14f8ab |
>Change-Id: Ibc02b89557baaed2f63db63d7fb1a7480444ae0d
|
|
|
14f8ab |
>fixes: bz#1702185
|
|
|
14f8ab |
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
14f8ab |
|
|
|
14f8ab |
Change-Id: Ibc02b89557baaed2f63db63d7fb1a7480444ae0d
|
|
|
14f8ab |
BUG: 1702240
|
|
|
14f8ab |
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
|
|
14f8ab |
Reviewed-on: https://code.engineering.redhat.com/gerrit/168616
|
|
|
14f8ab |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
14f8ab |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
14f8ab |
---
|
|
|
14f8ab |
xlators/mgmt/glusterd/src/glusterd-shd-svc.c | 3 +++
|
|
|
14f8ab |
xlators/mgmt/glusterd/src/glusterd-svc-helper.c | 4 ++++
|
|
|
14f8ab |
2 files changed, 7 insertions(+)
|
|
|
14f8ab |
|
|
|
14f8ab |
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
|
|
14f8ab |
index 19eca9f..a9eab42 100644
|
|
|
14f8ab |
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
|
|
14f8ab |
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
|
|
14f8ab |
@@ -452,8 +452,11 @@ glusterd_shdsvc_start(glusterd_svc_t *svc, int flags)
|
|
|
14f8ab |
}
|
|
|
14f8ab |
|
|
|
14f8ab |
if (shd->attached) {
|
|
|
14f8ab |
+ glusterd_volinfo_ref(volinfo);
|
|
|
14f8ab |
+ /* Unref will happen from glusterd_svc_attach_cbk */
|
|
|
14f8ab |
ret = glusterd_attach_svc(svc, volinfo, flags);
|
|
|
14f8ab |
if (ret) {
|
|
|
14f8ab |
+ glusterd_volinfo_unref(volinfo);
|
|
|
14f8ab |
gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_VOLINFO_GET_FAIL,
|
|
|
14f8ab |
"Failed to attach shd svc(volume=%s) to pid=%d. Starting"
|
|
|
14f8ab |
"a new process",
|
|
|
14f8ab |
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
|
|
14f8ab |
index 02945b1..f7be394 100644
|
|
|
14f8ab |
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
|
|
14f8ab |
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
|
|
14f8ab |
@@ -695,6 +695,10 @@ out:
|
|
|
14f8ab |
if (flag) {
|
|
|
14f8ab |
GF_FREE(flag);
|
|
|
14f8ab |
}
|
|
|
14f8ab |
+
|
|
|
14f8ab |
+ if (volinfo)
|
|
|
14f8ab |
+ glusterd_volinfo_unref(volinfo);
|
|
|
14f8ab |
+
|
|
|
14f8ab |
GF_ATOMIC_DEC(conf->blockers);
|
|
|
14f8ab |
STACK_DESTROY(frame->root);
|
|
|
14f8ab |
return 0;
|
|
|
14f8ab |
--
|
|
|
14f8ab |
1.8.3.1
|
|
|
14f8ab |
|