diff options
author | Kotresh HR <khiremat@redhat.com> | 2018-05-25 08:55:11 -0400 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2018-05-29 14:38:25 +0000 |
commit | 49095af5b431b8fdd90c7a578cdeba329bda4a3e (patch) | |
tree | af277c140484628906241c8c7e76233e4652d838 /api/src | |
parent | e36d5c6b8c1c3800ef89a0251854bd2b7e2af924 (diff) | |
download | glusterfs-49095af5b431b8fdd90c7a578cdeba329bda4a3e.tar.gz glusterfs-49095af5b431b8fdd90c7a578cdeba329bda4a3e.tar.xz glusterfs-49095af5b431b8fdd90c7a578cdeba329bda4a3e.zip |
libgfapi: Fix lookup on root
Lookup on root was sending "/" as the path.
This will break the basename calculation in
loc_copy and hence lookup on root was failing
if the loc_copy was involved in the stack.
With ctime, a first lookup on root initiates
a metadata self heal because of ctime xattr
not being same on all afr subvolumes. This
results in loc_copy and hence the failure
of lookup.
Fix would be to send path with "." for the root.
Backport of:
> Patch: https://review.gluster.org/#/c/20086/
> BUG: 1582516
> Change-Id: Iafe4b99f249a4f5034ad34c1d30590de0e35aa0d
(cherry picked from commit 3d38e4e47f129bdb36c3fbbd481dabe4ba4413d6)
fixes: bz#1583016
Change-Id: Iafe4b99f249a4f5034ad34c1d30590de0e35aa0d
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'api/src')
-rw-r--r-- | api/src/glfs-resolve.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c index 6c9fc38901..51b31d2ae6 100644 --- a/api/src/glfs-resolve.c +++ b/api/src/glfs-resolve.c @@ -241,9 +241,9 @@ glfs_resolve_root (struct glfs *fs, xlator_t *subvol, inode_t *inode, loc.inode = inode_ref (inode); - ret = inode_path (loc.inode, NULL, &path); + ret = inode_path (loc.inode, ".", &path); loc.path = path; - loc.name = ""; + loc.name = "."; /* Having a value in loc.name will help to bypass md-cache check for * nameless lookup. * TODO: Re-visit on nameless lookup and md-cache. |