summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs-common.c
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/nfs/server/src/nfs-common.c
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/nfs/server/src/nfs-common.c')
-rw-r--r--xlators/nfs/server/src/nfs-common.c30
1 files changed, 24 insertions, 6 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)