summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/gf_attach.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2019-06-05 20:16:40 +0300
committerAtin Mukherjee <amukherj@redhat.com>2019-07-16 13:34:56 +0000
commit7162c8ad9d404773656b4eb02c8fc17f067e7699 (patch)
treea83da6e6b2be8f4e38d83947347dad9ffb1ffa91 /glusterfsd/src/gf_attach.c
parent6bf9637a93011298d032332ca93009ba4e377e46 (diff)
cli: defer create_frame() (and dict creation) to later stages.
Where possible, defer create_frame() - whenever possible, after command line verification, for example. Change-Id: Id6606e90e7ea6190f30b225c4733b229c519bb2f updates: bz#1193929 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'glusterfsd/src/gf_attach.c')
-rw-r--r--glusterfsd/src/gf_attach.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/glusterfsd/src/gf_attach.c b/glusterfsd/src/gf_attach.c
index e688c3c9eb4..cb6c0f59b0b 100644
--- a/glusterfsd/src/gf_attach.c
+++ b/glusterfsd/src/gf_attach.c
@@ -75,10 +75,6 @@ send_brick_req(xlator_t *this, struct rpc_clnt *rpc, char *path, int op)
if (!iobref)
goto out;
- frame = create_frame(this, this->ctx->pool);
- if (!frame)
- goto out;
-
iobref_add(iobref, iobuf);
iov.iov_base = iobuf->ptr;
@@ -98,6 +94,12 @@ send_brick_req(xlator_t *this, struct rpc_clnt *rpc, char *path, int op)
sleep(1);
}
+ frame = create_frame(this, this->ctx->pool);
+ if (!frame) {
+ ret = -1;
+ goto out;
+ }
+
/* Send the msg */
ret = rpc_clnt_submit(rpc, &gf_attach_prog, op, my_callback, &iov, 1, NULL,
0, iobref, frame, NULL, 0, NULL, 0, NULL);