diff options
-rw-r--r-- | xlators/nfs/server/src/nfs-common.c | 30 | ||||
-rw-r--r-- | xlators/nfs/server/src/nfs.c | 4 | ||||
-rw-r--r-- | xlators/nfs/server/src/nfs3-helpers.c | 21 |
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 7c433fe68..1c0fb1755 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 9c942e1af..2bc7f02fc 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 6ead01546..25ea340db 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 |