summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server
diff options
context:
space:
mode:
authorRyan Ding <ryan.ding@open-fs.com>2016-08-24 00:41:13 +0800
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-08-24 19:06:25 -0700
commitc70f4b3af619bcdd08d57147a4ed582bdad98084 (patch)
treed3a0426f5cf6928dfdb1c021e4e1a71b6cdb2976 /xlators/protocol/server
parent56a79b357e09d91305994fcc0b2d250cb9ac243d (diff)
protocol/server: readlink rsp xdr will fail while readlink got an error
set gfs3_readlink_rsp.path with an empty string while error happen, to make xdr_gfs3_readlink_rsp happy. otherwise the original errno will be lost, and return an rpc internal errno instead. Change-Id: I36655b66df8b9f164e5bd21eb17244722c2f5a52 BUG: 1369530 Signed-off-by: Ryan Ding <ryan.ding@open-fs.com> Reviewed-on: http://review.gluster.org/15299 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r--xlators/protocol/server/src/server-common.c3
-rw-r--r--xlators/protocol/server/src/server-helpers.c2
-rw-r--r--xlators/protocol/server/src/server-rpc-fops.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/xlators/protocol/server/src/server-common.c b/xlators/protocol/server/src/server-common.c
index fd6749a4df7..9a023aaa49e 100644
--- a/xlators/protocol/server/src/server-common.c
+++ b/xlators/protocol/server/src/server-common.c
@@ -21,9 +21,6 @@ server_post_readlink (gfs3_readlink_rsp *rsp, struct iatt *stbuf,
{
gf_stat_from_iatt (&rsp->buf, stbuf);
rsp->path = (char *)buf;
-
- if (!rsp->path)
- rsp->path = "";
}
void
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 39fbcbc6763..474db926629 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -2321,6 +2321,8 @@ server_populate_compound_response (xlator_t *this, gfs3_compound_rsp *rsp,
rsp_args->op_ret = this_args_cbk->op_ret;
rsp_args->op_errno = gf_errno_to_error
(this_args_cbk->op_errno);
+ if (!rsp_args->path)
+ rsp_args->path = "";
break;
}
case GF_FOP_MKNOD:
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
index 91644ce0103..fa160a52d79 100644
--- a/xlators/protocol/server/src/server-rpc-fops.c
+++ b/xlators/protocol/server/src/server-rpc-fops.c
@@ -1569,6 +1569,8 @@ server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
out:
rsp.op_ret = op_ret;
rsp.op_errno = gf_errno_to_error (op_errno);
+ if (!rsp.path)
+ rsp.path = "";
req = frame->local;
server_submit_reply (frame, req, &rsp, NULL, 0, NULL,