summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2009-02-26 08:09:25 -0800
committerAnand V. Avati <avati@amp.gluster.com>2009-02-27 16:13:55 +0530
commit8462dd88ad3531837ebfccd17a083467faa40227 (patch)
tree694d75c75bb88bcc67a4f1893330de03be0c4793 /xlators/protocol/client
parentda9664587d414ba703c46839e3a4831ad3784a19 (diff)
volumefile modification awareness to make sure there are no inconsistencies.
Complete (including feature to properly umount) in my sense. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/protocol/client')
-rw-r--r--xlators/protocol/client/src/client-protocol.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c
index da2242ad6..11e669833 100644
--- a/xlators/protocol/client/src/client-protocol.c
+++ b/xlators/protocol/client/src/client-protocol.c
@@ -5875,7 +5875,7 @@ client_setvolume_cbk (call_frame_t *frame,
op_ret = ntoh32 (hdr->rsp.op_ret);
op_errno = gf_error_to_errno (ntoh32 (hdr->rsp.op_errno));
- if (op_ret < 0 && op_errno == ENOTCONN) {
+ if ((op_ret < 0) && (op_errno == ENOTCONN)) {
gf_log (this->name, GF_LOG_ERROR,
"setvolume failed (%s)",
strerror (op_errno));
@@ -5911,8 +5911,16 @@ client_setvolume_cbk (call_frame_t *frame,
"SETVOLUME on remote-host failed: %s",
remote_error ? remote_error : strerror (op_errno));
errno = op_errno;
- if (op_errno == ENOTCONN)
- goto out;
+ if (op_errno == ESTALE) {
+ parent = trans->xl->parents;
+ while (parent) {
+ parent->xlator->notify (parent->xlator,
+ GF_EVENT_VOLFILE_MODIFIED,
+ trans->xl);
+ parent = parent->next;
+ }
+ }
+
} else {
ctx = get_global_ctx_ptr ();
if (process_uuid && !strcmp (ctx->process_uuid,process_uuid)) {
@@ -6439,6 +6447,14 @@ protocol_client_handshake (xlator_t *this, transport_t *trans)
PACKAGE_VERSION);
}
+ if (this->ctx->cmd_args.volfile_server) {
+ if (this->ctx->cmd_args.volfile_id)
+ ret = dict_set_str (options, "volfile-key",
+ this->ctx->cmd_args.volfile_id);
+ ret = dict_set_uint32 (options, "volfile-checksum",
+ this->ctx->volfile_checksum);
+ }
+
dict_len = dict_serialized_length (options);
if (dict_len < 0) {
gf_log (this->name, GF_LOG_ERROR,