summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-resolve.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index 7cd1e47bc8f..fd0ed757ffe 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -241,11 +241,15 @@ glfs_resolve_component (struct glfs *fs, xlator_t *subvol, inode_t *parent,
uuid_copy (loc.pargfid, parent->gfid);
- if (strcmp (component, ".") == 0)
+ if (strcmp (component, ".") == 0) {
loc.inode = inode_ref (parent);
- else if (strcmp (component, "..") == 0)
- loc.inode = inode_parent (parent, 0, 0);
- else
+ } else if (strcmp (component, "..") == 0) {
+ if (__is_root_gfid (parent->gfid))
+ /* ".." on root points to itself */
+ loc.inode = inode_ref (parent);
+ else
+ loc.inode = inode_parent (parent, 0, 0);
+ } else
loc.inode = inode_grep (parent->table, parent, component);
if (loc.inode) {