From 59186114f9545fda529368ee26c3cd3d88a80751 Mon Sep 17 00:00:00 2001 From: Anuradha Talur Date: Tue, 9 Aug 2016 21:09:11 +0530 Subject: protocol/client: Unserialize xdata even if lookup fails Problem: AFR relies on xdata returned by lookup to determine if there are any files that need healing. This info is further used to optimize readdirp. In case of lookups with negative return value, client xlator was sending NULL xdata. Due to absence of xdata, AFR conservatively assumes that there are files that need healing, which is incorrect. Solution: Even in case of unsuccessful lookups, send the xdata received by protocol client so that higher xlators can get the info that they rely on. Change-Id: Id3a1023eb536180888eb2c0b39050000b76f7226 BUG: 1366284 Signed-off-by: Anuradha Talur Reviewed-on: http://review.gluster.org/15120 Smoke: Gluster Build System Reviewed-by: Poornima G Tested-by: Poornima G CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Ashish Pandey Reviewed-by: Pranith Kumar Karampuri --- xlators/protocol/client/src/client-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/protocol/client/src/client-common.c') diff --git a/xlators/protocol/client/src/client-common.c b/xlators/protocol/client/src/client-common.c index 51c2d95ea2b..05939b8aa0b 100644 --- a/xlators/protocol/client/src/client-common.c +++ b/xlators/protocol/client/src/client-common.c @@ -1829,6 +1829,7 @@ int client_post_lookup (xlator_t *this, gfs3_lookup_rsp *rsp, struct iatt *stbuf, struct iatt *postparent, dict_t **xdata) { + int ret = 0; if (-1 != rsp->op_ret) { gf_stat_to_iatt (&rsp->postparent, postparent); @@ -1836,11 +1837,10 @@ client_post_lookup (xlator_t *this, gfs3_lookup_rsp *rsp, struct iatt *stbuf, } GF_PROTOCOL_DICT_UNSERIALIZE (this, *xdata, (rsp->xdata.xdata_val), - (rsp->xdata.xdata_len), rsp->op_ret, + (rsp->xdata.xdata_len), ret, rsp->op_errno, out); - out: - return rsp->op_ret; + return ret; } int -- cgit