protocol/server : unwind as per op version

Change-Id: Id6717640ac14881b490e512c4682e45ffffa7f5b
fixes: bz#1570538
BUG: 1570538
Signed-off-by: Ashish Pandey <aspandey@redhat.com>
This commit is contained in:
Ashish Pandey 2018-04-25 16:48:56 +05:30 committed by Xavi Hernandez
parent 11b747bcec
commit 112048652a
3 changed files with 11 additions and 3 deletions

View File

@ -46,6 +46,7 @@ typedef struct _client {
char *subdir_mount;
inode_t *subdir_inode;
uuid_t subdir_gfid;
int32_t opversion;
} client_t;
#define GF_CLIENTCTX_INITIAL_SIZE 8

View File

@ -1562,7 +1562,13 @@ int
pl_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *xdata)
{
PL_STACK_UNWIND (flush, xdata, frame, op_ret, op_errno, xdata);
if (frame->root->client &&
(frame->root->client->opversion < GD_OP_VERSION_3_10_0)) {
STACK_UNWIND_STRICT (flush, frame, op_ret, op_errno, xdata);
} else {
PL_STACK_UNWIND (flush, xdata, frame, op_ret, op_errno, xdata);
}
return 0;
}

View File

@ -747,11 +747,12 @@ server_setvolume (rpcsvc_request_t *req)
}
ret = dict_get_uint32 (params, "opversion", &opversion);
if (ret)
if (ret) {
gf_msg (this->name, GF_LOG_INFO, 0,
PS_MSG_CLIENT_OPVERSION_GET_FAILED,
"Failed to get client opversion");
}
client->opversion = opversion;
/* Assign op-version value to the client */
pthread_mutex_lock (&conf->mutex);
list_for_each_entry (xprt, &conf->xprt_list, list) {