summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-11-21 06:48:17 -0800
committerVijay Bellur <vbellur@redhat.com>2013-11-26 10:29:23 -0800
commitd1879d04e39258ea25a49eed3244b395d4af2c1d (patch)
tree5f919b61f9eb05a5bd5cd760b83603be1c0a4257 /xlators/protocol
parentec8c678c4d8b948c1b471e497db5adc0221c154b (diff)
core: fix errno for non-existent GFID
When clients refer to a GFID which does not exist, the errno to be returned in ESTALE (and not ENOENT). Even though ENOENT might look "proper" most of the time, as the application eventually expects ENOENT even if a parent directory does not exist, not returning ESTALE results in resolvers (FUSE and GFAPI) to not retry resolution in uncached mode. This can result in spurious ENOENTs during concurrent path modification operations. Change-Id: I7a06ea6d6a191739f2e9c6e333a1969615e05936 BUG: 1032894 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6318 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@gmail.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c3
-rw-r--r--xlators/protocol/server/src/server-resolve.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index 6901d8e2c3b..01590d73afc 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -2763,7 +2763,8 @@ out:
rsp.op_errno = op_errno;
if (rsp.op_ret == -1) {
/* any error other than ENOENT */
- if (rsp.op_errno != ENOENT)
+ if (!(local->loc.name && rsp.op_errno == ENOENT) &&
+ !(rsp.op_errno == ESTALE))
gf_log (this->name, GF_LOG_WARNING,
"remote operation failed: %s. Path: %s (%s)",
strerror (rsp.op_errno), local->loc.path,
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c
index cc4686a0399..b2bff5c531a 100644
--- a/xlators/protocol/server/src/server-resolve.c
+++ b/xlators/protocol/server/src/server-resolve.c
@@ -246,7 +246,7 @@ resolve_entry_simple (call_frame_t *frame)
/* simple resolution is indecisive. need to perform
deep resolution */
resolve->op_ret = -1;
- resolve->op_errno = ENOENT;
+ resolve->op_errno = ESTALE;
ret = 1;
goto out;
}
@@ -343,7 +343,7 @@ resolve_inode_simple (call_frame_t *frame)
if (!inode) {
resolve->op_ret = -1;
- resolve->op_errno = ENOENT;
+ resolve->op_errno = ESTALE;
ret = 1;
goto out;
}