summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/src/gfapi-messages.h3
-rw-r--r--api/src/glfs-fops.c1
-rw-r--r--api/src/glfs-handleops.c8
-rw-r--r--api/src/glfs-resolve.c14
4 files changed, 18 insertions, 8 deletions
diff --git a/api/src/gfapi-messages.h b/api/src/gfapi-messages.h
index c54d821efc7..d15e914dd06 100644
--- a/api/src/gfapi-messages.h
+++ b/api/src/gfapi-messages.h
@@ -45,7 +45,7 @@
*/
#define GLFS_GFAPI_BASE GLFS_MSGID_COMP_API
-#define GLFS_NUM_MESSAGES 47
+#define GLFS_NUM_MESSAGES 48
#define GLFS_MSGID_END (GLFS_GFAPI_BASE + GLFS_NUM_MESSAGESi + 1)
/* Messages with message IDs */
#define glfs_msg_start_x GLFS_GFAPI_BASE, "Invalid: Start of messages"
@@ -98,6 +98,7 @@
#define API_MSG_NEW_GRAPH (GLFS_GFAPI_BASE + 45)
#define API_MSG_ALLOC_FAILED (GLFS_GFAPI_BASE + 46)
#define API_MSG_CREATE_HANDLE_FAILED (GLFS_GFAPI_BASE + 47)
+#define API_MSG_INODE_LINK_FAILED (GLFS_GFAPI_BASE + 48)
/*------------*/
#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index f01d6adf0ba..0031061620f 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -127,7 +127,6 @@ glfs_loc_link (loc_t *loc, struct iatt *iatt)
ret = 0;
} else {
ret = -1;
- errno = ENOMEM;
}
return ret;
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 72aa7de146e..721187f8342 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1332,11 +1332,9 @@ pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
}
inode_lookup (newinode);
} else {
- gf_msg (subvol->name, GF_LOG_WARNING, EINVAL,
- API_MSG_INVALID_ENTRY,
- "inode linking of %s failed: %s",
- uuid_utoa (loc.gfid), strerror (errno));
- errno = EINVAL;
+ gf_msg (subvol->name, GF_LOG_WARNING, errno,
+ API_MSG_INODE_LINK_FAILED,
+ "inode linking of %s failed", uuid_utoa (loc.gfid));
goto out;
}
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index f8933326433..c2c6e64fb9d 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -134,6 +134,11 @@ glfs_refresh_inode_safe (xlator_t *subvol, inode_t *oldinode,
if (newinode == loc.inode)
inode_ctx_set (newinode, THIS, &ctx_value);
inode_lookup (newinode);
+ } else {
+ gf_msg (subvol->name, GF_LOG_WARNING, errno,
+ API_MSG_INODE_LINK_FAILED,
+ "inode linking of %s failed",
+ uuid_utoa ((unsigned char *)&iatt.ia_gfid));
}
loc_wipe (&loc);
@@ -346,7 +351,14 @@ glfs_resolve_component (struct glfs *fs, xlator_t *subvol, inode_t *parent,
goto out;
inode = inode_link (loc.inode, loc.parent, component, &ciatt);
- if (inode == loc.inode)
+
+ if (!inode) {
+ gf_msg (subvol->name, GF_LOG_WARNING, errno,
+ API_MSG_INODE_LINK_FAILED,
+ "inode linking of %s failed",
+ uuid_utoa ((unsigned char *)&ciatt.ia_gfid));
+ goto out;
+ } else if (inode == loc.inode)
inode_ctx_set (inode, THIS, &ctx_value);
found:
if (inode)