summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-resolve.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-03-16 09:43:27 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-17 11:59:12 -0700
commit0349ec857004428f29b50f3604e5ab126dfb407e (patch)
tree57fddfe66b1d2df91a9a75198e41a795f8412c04 /xlators/protocol/server/src/server-resolve.c
parentd3e9a97b6ef340f827cf55de5340a8bf5c732f3e (diff)
protocol/server: log enhancements
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'xlators/protocol/server/src/server-resolve.c')
-rw-r--r--xlators/protocol/server/src/server-resolve.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/xlators/protocol/server/src/server-resolve.c b/xlators/protocol/server/src/server-resolve.c
index 1da41b2fd59..0b0487a242a 100644
--- a/xlators/protocol/server/src/server-resolve.c
+++ b/xlators/protocol/server/src/server-resolve.c
@@ -70,7 +70,8 @@ prepare_components (call_frame_t *frame)
count = component_count (resolve->path);
components = GF_CALLOC (sizeof (*components), count,
gf_server_mt_resolv_comp_t);
- GF_VALIDATE_OR_GOTO ("server", components, out);
+ if (!components)
+ goto out;
resolve->components = components;
@@ -194,6 +195,10 @@ resolve_deep_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
i = (long) cookie;
if (op_ret == -1) {
+ gf_log (this->name, ((op_errno == ENOENT) ? GF_LOG_DEBUG :
+ GF_LOG_WARNING),
+ "%s: failed to resolve (%s)",
+ resolve->resolved, strerror (op_errno));
goto get_out_of_here;
}
@@ -285,6 +290,8 @@ resolve_path_simple (call_frame_t *frame)
components = resolve->components;
if (!components) {
+ gf_log ("", GF_LOG_INFO,
+ "failed to resolve, component not found");
resolve->op_ret = -1;
resolve->op_errno = ENOENT;
goto out;
@@ -296,6 +303,8 @@ resolve_path_simple (call_frame_t *frame)
}
if (ino_idx == -1) {
+ gf_log ("", GF_LOG_INFO,
+ "failed to resolve, inode index not found");
resolve->op_ret = -1;
resolve->op_errno = EINVAL;
goto out;
@@ -306,6 +315,8 @@ resolve_path_simple (call_frame_t *frame)
goto noparent;
if (!components[par_idx].inode) {
+ gf_log ("", GF_LOG_INFO,
+ "failed to resolve, parent inode not found");
resolve->op_ret = -1;
resolve->op_errno = ENOENT;
goto out;
@@ -315,12 +326,16 @@ noparent:
if (!components[ino_idx].inode &&
(resolve->type == RESOLVE_MUST || resolve->type == RESOLVE_EXACT)) {
+ gf_log ("", GF_LOG_INFO,
+ "failed to resolve, inode not found");
resolve->op_ret = -1;
resolve->op_errno = ENOENT;
goto out;
}
if (components[ino_idx].inode && resolve->type == RESOLVE_NOT) {
+ gf_log ("", GF_LOG_INFO,
+ "failed to resolve, inode found");
resolve->op_ret = -1;
resolve->op_errno = EEXIST;
goto out;
@@ -399,7 +414,7 @@ resolve_entry_simple (call_frame_t *frame)
}
if (resolve->type == RESOLVE_NOT) {
- gf_log (this->name, GF_LOG_DEBUG, "inode (pointer: %p ino:%"
+ gf_log (this->name, GF_LOG_INFO, "inode (pointer: %p ino:%"
PRIu64") found for path (%s) while type is RESOLVE_NOT",
inode, inode->ino, resolve->path);
resolve->op_ret = -1;
@@ -526,6 +541,7 @@ server_resolve_fd (call_frame_t *frame)
state->fd = gf_fd_fdptr_get (conn->fdtable, fd_no);
if (!state->fd) {
+ gf_log ("", GF_LOG_INFO, "fd not found in context");
resolve->op_ret = -1;
resolve->op_errno = EBADF;
}
@@ -559,7 +575,7 @@ server_resolve (call_frame_t *frame)
} else if (resolve->path) {
- gf_log (frame->this->name, GF_LOG_WARNING,
+ gf_log (frame->this->name, GF_LOG_INFO,
"pure path resolution for %s (%s)",
resolve->path, gf_fop_list[frame->root->op]);
resolve_path_deep (frame);