summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorGaurav <gaurav@gluster.com>2011-10-11 11:15:30 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-16 02:05:27 -0800
commitd4ff78d02d049335d827f9293a4e931261b5c2bb (patch)
treeb1cb08b8c23f561ced5ef7cf7afeeb7f0d9a244b /xlators
parentf97897c394a7f3e9d5e870ba9814ff2ebfc4cc01 (diff)
NFS: logging enhancement.
Change-Id: Ie1731a6b2b63e07bc49a84c2f9dd87c5b50a9f53 BUG: 3527 Reviewed-on: http://review.gluster.com/573 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/nfs/server/src/nfs-common.c30
-rw-r--r--xlators/nfs/server/src/nfs.c4
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c21
3 files changed, 41 insertions, 14 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c
index 7c433fe689d..1c0fb175591 100644
--- a/xlators/nfs/server/src/nfs-common.c
+++ b/xlators/nfs/server/src/nfs-common.c
@@ -178,8 +178,10 @@ nfs_loc_copy (loc_t *dst, loc_t *src)
dst->path = gf_strdup (src->path);
- if (!dst->path)
+ if (!dst->path) {
+ gf_log (GF_NFS, GF_LOG_ERROR, "strdup failed");
goto out;
+ }
dst->name = strrchr (dst->path, '/');
if (dst->name)
@@ -224,8 +226,10 @@ nfs_loc_fill (loc_t *loc, inode_t *inode, inode_t *parent, char *path)
loc->name = strrchr (loc->path, '/');
if (loc->name)
loc->name++;
- else
+ else {
+ gf_log (GF_NFS, GF_LOG_ERROR, "No / in path %s", loc->path);
goto loc_wipe;
+ }
ret = 0;
loc_wipe:
@@ -255,12 +259,18 @@ nfs_inode_loc_fill (inode_t *inode, loc_t *loc)
ignore_parent:
ret = inode_path (inode, NULL, &resolvedpath);
- if (ret < 0)
+ if (ret < 0) {
+ gf_log (GF_NFS, GF_LOG_ERROR, "path resolution failed %s",
+ resolvedpath);
goto err;
+ }
ret = nfs_loc_fill (loc, inode, parent, resolvedpath);
- if (ret < 0)
+ if (ret < 0) {
+ gf_log (GF_NFS, GF_LOG_ERROR, "loc fill resolution failed %s",
+ resolvedpath);
goto err;
+ }
err:
if (parent)
@@ -318,8 +328,11 @@ nfs_parent_inode_loc_fill (inode_t *parent, inode_t *entryinode, char *entry,
return ret;
ret = inode_path (parent, entry, &path);
- if (ret < 0)
+ if (ret < 0) {
+ gf_log (GF_NFS, GF_LOG_ERROR, "path resolution failed %s",
+ path);
goto err;
+ }
ret = nfs_loc_fill (loc, entryinode, parent, path);
GF_FREE (path);
@@ -381,13 +394,18 @@ nfs_entry_loc_fill (inode_table_t *itable, uuid_t pargfid, char *entry,
ret = inode_path (parent, entry, &resolvedpath);
if (ret < 0) {
+ gf_log (GF_NFS, GF_LOG_ERROR, "path resolution failed %s",
+ resolvedpath);
ret = -3;
goto err;
}
ret = nfs_loc_fill (loc, entryinode, parent, resolvedpath);
- if (ret < 0)
+ if (ret < 0) {
+ gf_log (GF_NFS, GF_LOG_ERROR, "loc_fill failed %s",
+ resolvedpath);
ret = -3;
+ }
err:
if (parent)
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 9c942e1af1b..2bc7f02fcd1 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -132,8 +132,10 @@ nfs_init_versions (struct nfs_state *nfs, xlator_t *this)
if (rpcsvc_register_portmap_enabled(nfs->rpcsvc)) {
ret = rpcsvc_program_register_portmap (prog,
prog->progport);
- if (ret == -1)
+ if (ret == -1) {
+ gf_log (GF_NFS, GF_LOG_ERROR, "Program registration failed");
goto err;
+ }
}
}
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 6ead0154690..25ea340dba4 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -1668,6 +1668,8 @@ nfs3_dir_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cs = frame->local;
if (op_ret == -1) {
+ gf_log (GF_NFS3, GF_LOG_ERROR, "Dir open failed path %s err %s"
+ , cs->resolvedloc.path, strerror (op_errno));
cs->resolve_ret = -1;
cs->resolve_errno = op_errno;
nfs3_call_resume (cs);
@@ -1948,7 +1950,7 @@ nfs3_file_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cs = frame->local;
if (op_ret == -1) {
- gf_log (GF_NFS3, GF_LOG_TRACE, "Opening uncached fd failed: "
+ gf_log (GF_NFS3, GF_LOG_ERROR, "Opening uncached fd failed: "
"%s", strerror(op_errno));
cs->resolve_ret = -1;
cs->resolve_errno = op_errno;
@@ -2419,8 +2421,10 @@ nfs3_fh_resolve_inode_done (nfs3_call_state_t *cs, inode_t *inode)
gf_log (GF_NFS3, GF_LOG_TRACE, "FH inode resolved");
ret = nfs_inode_loc_fill (inode, &cs->resolvedloc);
- if (ret < 0)
+ if (ret < 0) {
+ gf_log (GF_NFS3, GF_LOG_ERROR, "inode loc fill failed");
goto err;
+ }
nfs3_call_resume (cs);
@@ -2493,7 +2497,8 @@ nfs3_fh_resolve_entry_lookup_cbk (call_frame_t *frame, void *cookie,
cs->resolve_errno = op_errno;
if (op_ret == -1) {
- gf_log (GF_NFS3, GF_LOG_TRACE, "Lookup failed: %s: %s",
+ gf_log (GF_NFS3, (op_errno == ENOENT ? GF_LOG_TRACE : GF_LOG_ERROR),
+ "Lookup failed: %s: %s",
cs->resolvedloc.path, strerror (op_errno));
goto err;
} else
@@ -2563,7 +2568,8 @@ nfs3_fh_resolve_parent_lookup_cbk (call_frame_t *frame, void *cookie,
cs->resolve_errno = op_errno;
if (op_ret == -1) {
- gf_log (GF_NFS3, GF_LOG_TRACE, "Lookup failed: %s: %s",
+ gf_log (GF_NFS3, (op_errno == ENOENT ? GF_LOG_TRACE : GF_LOG_ERROR),
+ "Lookup failed: %s: %s",
cs->resolvedloc.path, strerror (op_errno));
nfs3_call_resume (cs);
goto err;
@@ -2643,7 +2649,7 @@ nfs3_fh_resolve_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
cs->resolve_errno = op_errno;
if (op_ret == -1) {
- gf_log (GF_NFS3, GF_LOG_TRACE, "Dir open failed: %s: %s",
+ gf_log (GF_NFS3, GF_LOG_ERROR, "Dir open failed: %s: %s",
cs->resolvedloc.path, strerror (op_errno));
nfs3_call_resume (cs);
goto err;
@@ -2684,7 +2690,8 @@ nfs3_fh_resolve_dir_lookup_cbk (call_frame_t *frame, void *cookie,
cs->resolve_errno = op_errno;
if (op_ret == -1) {
- gf_log (GF_NFS3, GF_LOG_TRACE, "Lookup failed: %s: %s",
+ gf_log (GF_NFS3, (op_errno == ENOENT ? GF_LOG_TRACE : GF_LOG_ERROR),
+ "Lookup failed: %s: %s",
cs->resolvedloc.path, strerror (op_errno));
nfs3_call_resume (cs);
goto err;
@@ -3081,7 +3088,7 @@ nfs3_fh_resolve_root_lookup_cbk (call_frame_t *frame, void *cookie,
cs->resolve_errno = op_errno;
if (op_ret == -1) {
- gf_log (GF_NFS3, GF_LOG_TRACE, "Root lookup failed: %s",
+ gf_log (GF_NFS3, GF_LOG_ERROR, "Root lookup failed: %s",
strerror (op_errno));
goto err;
} else