diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2015-07-01 16:54:55 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-07-02 04:11:52 -0700 |
commit | 4242857196697d3fcfc0c7a75ede4a666518ea0b (patch) | |
tree | 41cc406e8f536d5bd2e2407d5e98e83a57c6a014 /xlators/protocol/server/src/server-handshake.c | |
parent | c1a8ae20bd055227921d199b952582eca4104f67 (diff) |
protocol/server: fail setvolume if any of xlators is not initialized yet
We can only start recieving fops only when all xlators in graph are
initialized.
Change-Id: Id79100bab5878bb2518ed133c1118554fbb35229
BUG: 1236945
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/11490
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server-handshake.c')
-rw-r--r-- | xlators/protocol/server/src/server-handshake.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 6d34fe8e35d..7ee12c49076 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -367,6 +367,23 @@ server_setvolume (rpcsvc_request_t *req) config_params = dict_copy_with_ref (this->options, NULL); conf = this->private; + if (conf->parent_up == _gf_false) { + /* PARENT_UP indicates that all xlators in graph are inited + * successfully + */ + op_ret = -1; + op_errno = EAGAIN; + + ret = dict_set_str (reply, "ERROR", + "xlator graph in server is not initialised " + "yet. Try again later"); + if (ret < 0) + gf_msg_debug (this->name, 0, "failed to set error: " + "xlator graph in server is not " + "initialised yet. Try again later"); + goto fail; + } + buf = memdup (args.dict.dict_val, args.dict.dict_len); if (buf == NULL) { op_ret = -1; |