diff options
author | Ravishankar N <ravishankar@redhat.com> | 2014-06-14 06:08:17 +0000 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-06-20 02:45:54 -0700 |
commit | 239a1dfca881d155811a170587fb00342765670f (patch) | |
tree | 49a82c2ee9f8b470d1e7218bcea7241bdd33d1b8 /xlators/protocol/server | |
parent | d01cd0ce5ade63476af48957ccd8761b4b02ac85 (diff) |
protocol/server: send ENOENT instead of ESTALE for older clients
Modify protocol/server and storage/posix to send ENOENT to older clients
instead of ESTALE
http://goo.gl/t83hmL
Change-Id: Ie63e91e73e33769ce9dc3d964938cfd6eb4c4be5
BUG: 1109832
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/8080
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/protocol/server')
-rw-r--r-- | xlators/protocol/server/src/server-resolve.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c index b2bff5c531a..c98c1ae5529 100644 --- a/xlators/protocol/server/src/server-resolve.c +++ b/xlators/protocol/server/src/server-resolve.c @@ -235,18 +235,27 @@ resolve_entry_simple (call_frame_t *frame) server_resolve_t *resolve = NULL; inode_t *parent = NULL; inode_t *inode = NULL; + int missing_gfid_estale = 0; int ret = 0; state = CALL_STATE (frame); this = frame->this; resolve = state->resolve_now; + 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"); + parent = inode_find (state->itable, resolve->pargfid); if (!parent) { /* simple resolution is indecisive. need to perform deep resolution */ resolve->op_ret = -1; - resolve->op_errno = ESTALE; + if (missing_gfid_estale) + resolve->op_errno = ESTALE; + else + resolve->op_errno = ENOENT; ret = 1; goto out; } @@ -332,18 +341,28 @@ int resolve_inode_simple (call_frame_t *frame) { server_state_t *state = NULL; + xlator_t *this = NULL; server_resolve_t *resolve = NULL; inode_t *inode = NULL; + int missing_gfid_estale = 0; int ret = 0; state = CALL_STATE (frame); + this = frame->this; resolve = state->resolve_now; + 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"); inode = inode_find (state->itable, resolve->gfid); if (!inode) { resolve->op_ret = -1; - resolve->op_errno = ESTALE; + if (missing_gfid_estale) + resolve->op_errno = ESTALE; + else + resolve->op_errno = ENOENT; ret = 1; goto out; } |