summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-rpc-fops.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2014-07-09 23:19:06 +0000
committerNiels de Vos <ndevos@redhat.com>2014-07-14 02:22:14 -0700
commit9d68bd17adf45b158ba8dd89f583805ae1a9e706 (patch)
tree68b27a37dc9c3c42189292d249e956fe1e3846ea /xlators/protocol/server/src/server-rpc-fops.c
parenta4369c456de4304ebdb252bc2783d634a56f8301 (diff)
protocol/server: '/s/ESTALE/ENOENT' only in lookup path
Problem: [1] modified the server resolver code to send ENOENT instead of ESTALE to older clients for all FOPS. This caused dht_mkdir to fail under certain conditions (see bug description). Fix: Since [1] is needed by AFR only in its lookup path, reverted the changes introduced by [1] in resolve_entry_simple () an resolve_inode_simple () and made the change instead in server_lookup_resume(). [1] http://review.gluster.org/#/c/8080 Change-Id: Idb2de25839fe712550486f2263a60c0531530d8f BUG: 1118574 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/8294 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/protocol/server/src/server-rpc-fops.c')
-rw-r--r--xlators/protocol/server/src/server-rpc-fops.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/protocol/server/src/server-rpc-fops.c b/xlators/protocol/server/src/server-rpc-fops.c
index e67d168..d69d51f 100644
--- a/xlators/protocol/server/src/server-rpc-fops.c
+++ b/xlators/protocol/server/src/server-rpc-fops.c
@@ -3013,8 +3013,15 @@ int
server_lookup_resume (call_frame_t *frame, xlator_t *bound_xl)
{
server_state_t *state = NULL;
+ xlator_t *this = NULL;
+ int missing_gfid_estale = 0;
state = CALL_STATE (frame);
+ this = frame->this;
+ if (dict_get_int32 (state->xdata, "missing-gfid-ESTALE",
+ &missing_gfid_estale))
+ gf_log (this->name, GF_LOG_DEBUG,
+ "missing-gfid-ESTALE key not present in dict");
if (state->resolve.op_ret != 0)
goto err;
@@ -3030,6 +3037,9 @@ server_lookup_resume (call_frame_t *frame, xlator_t *bound_xl)
return 0;
err:
+
+ if ((state->resolve.op_errno == ESTALE) && !missing_gfid_estale)
+ state->resolve.op_errno = ENOENT;
server_lookup_cbk (frame, NULL, frame->this, state->resolve.op_ret,
state->resolve.op_errno, NULL, NULL, NULL, NULL);