summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2014-06-14 06:08:17 +0000
committerVijay Bellur <vbellur@redhat.com>2014-06-20 02:45:54 -0700
commit239a1dfca881d155811a170587fb00342765670f (patch)
tree49a82c2ee9f8b470d1e7218bcea7241bdd33d1b8 /xlators/storage/posix/src/posix.c
parentd01cd0ce5ade63476af48957ccd8761b4b02ac85 (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/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 71daa3e3761..6cfa2224d94 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -99,6 +99,7 @@ posix_lookup (call_frame_t *frame, xlator_t *this,
int32_t op_ret = -1;
int32_t entry_ret = 0;
int32_t op_errno = 0;
+ int32_t missing_gfid_estale = 0;
dict_t * xattr = NULL;
char * real_path = NULL;
char * par_path = NULL;
@@ -125,6 +126,8 @@ posix_lookup (call_frame_t *frame, xlator_t *this,
}
op_ret = dict_get_int32 (xdata, GF_GFIDLESS_LOOKUP, &gfidless);
+ op_ret = dict_get_int32 (xdata, "missing-gfid-ESTALE",
+ &missing_gfid_estale);
op_ret = -1;
if (uuid_is_null (loc->pargfid) || (loc->name == NULL)) {
/* nameless lookup */
@@ -165,12 +168,17 @@ parent:
gf_log (this->name, GF_LOG_ERROR,
"post-operation lstat on parent %s failed: %s",
par_path, strerror (op_errno));
- if (op_errno == ENOENT)
+ if (op_errno == ENOENT) {
/* If parent directory is missing in a lookup,
errno should be ESTALE (bad handle) and not
- ENOENT (missing entry)
+ ENOENT (missing entry). But do this only for
+ 3.5 clients or newer. Older clients (AFR)
+ still expect ENOENT to function correctly.
*/
- op_errno = ESTALE;
+ if (missing_gfid_estale) {
+ op_errno = ESTALE;
+ }
+ }
goto out;
}
}