summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-resolve.c
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2009-10-28 02:36:31 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-28 01:46:31 -0700
commitb4dd7534007dccbc90d7341259bd92a0ff6a678c (patch)
treeac9a57a32b91530875688250690422ba6597ec85 /xlators/protocol/server/src/server-resolve.c
parent3809bb1bbd617dbde1d943dbcf6b0346329187b6 (diff)
protocol/server: resolver fixes
1. do not set ENOENT for RESOLVE_MAY case 2. set op_ret to -1 and op_errno to EINVAL when request has neither of entry, inode or fd handles Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'xlators/protocol/server/src/server-resolve.c')
-rw-r--r--xlators/protocol/server/src/server-resolve.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c
index 586790479..52d30b259 100644
--- a/xlators/protocol/server/src/server-resolve.c
+++ b/xlators/protocol/server/src/server-resolve.c
@@ -123,7 +123,7 @@ resolve_loc_touchup (call_frame_t *frame)
if (loc->name)
loc->name++;
- if (!loc->parent) {
+ if (!loc->parent && loc->inode) {
loc->parent = inode_parent (loc->inode, 0, NULL);
}
@@ -151,8 +151,7 @@ resolve_deep_continue (call_frame_t *frame)
else
ret = resolve_inode_simple (frame);
- if (ret == 0)
- resolve_loc_touchup (frame);
+ resolve_loc_touchup (frame);
server_resolve_all (frame);
@@ -230,8 +229,9 @@ resolve_path_deep (call_frame_t *frame)
this = frame->this;
resolve = state->resolve_now;
- gf_log (frame->this->name, GF_LOG_WARNING,
- "seeking deep resolution of %s", resolve->path);
+ gf_log (BOUND_XL (frame)->name, GF_LOG_WARNING,
+ "RESOLVE %s() seeking deep resolution of %s",
+ gf_fop_list[frame->root->op], resolve->path);
prepare_components (frame);
@@ -297,6 +297,9 @@ resolve_entry_simple (call_frame_t *frame)
case RESOLVE_NOT:
ret = 0;
break;
+ case RESOLVE_MAY:
+ ret = 1;
+ break;
default:
resolve->op_ret = -1;
resolve->op_errno = ENOENT;
@@ -489,6 +492,10 @@ server_resolve (call_frame_t *frame)
server_resolve_inode (frame);
} else {
+
+ resolve->op_ret = -1;
+ resolve->op_errno = EINVAL;
+
server_resolve_all (frame);
}