summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-07 05:41:50 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-08 15:06:04 +0530
commit364af2266e9cd9d1f4d88763e61a5b28d1336414 (patch)
treed1392eacca093ea325d3647dab734f4d13959f9e /libglusterfsclient
parent353f30ad17c9ace576df47abedf71054d8eb434e (diff)
libglusterfsclient: Return ENOENT on missing ancestor component
If any of the path's components, except the basename, are missing from the dentry cache and the corresponding lookup from the server also fails, return an ENOENT. Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 6dcda493201..848bda9b524 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -3369,6 +3369,12 @@ glusterfs_mkdir (glusterfs_handle_t handle,
goto out;
}
+ op_ret = libgf_client_path_lookup (&loc, ctx, 0);
+ if (op_ret == -1) {
+ errno = ENOENT;
+ goto out;
+ }
+
pathname = strdup (path);
name = basename (pathname);