diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2014-10-30 10:56:17 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-11-16 23:36:42 -0800 |
commit | 139e8d797bf48acfbc422a7d12740c65c34790fc (patch) | |
tree | f2469b1e445618eb89eb7ab2608b83209315aec8 /xlators | |
parent | 4bc694954190ce62953e1dfd470f621e85138ccc (diff) |
inode: Handle '/' in basename in inode_link/unlink
Backport of http://review.gluster.org/9004
Problem:
inode_link is sometimes called with a trailing '/'. Lookup, dentry
operations like link/unlink/mkdir/rmdir/rename etc come without trailing
'/' so the stale dentry with '/' remains in the dentry list of the inode.
Fix:
Add assert checks and return NULL for '/' in bname.
Fix ancestry building code to call without '/' at the end.
BUG: 1163570
Change-Id: I96655a0eb4678f80082705ab167327e72f54fa45
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9111
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/storage/posix/src/posix-handle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c index 9439b295cb9..ab202d79dc9 100644 --- a/xlators/storage/posix/src/posix-handle.c +++ b/xlators/storage/posix/src/posix-handle.c @@ -162,7 +162,6 @@ posix_make_ancestryfromgfid (xlator_t *this, char *path, int pathsize, pgfidstr = strtok_r (linkname + SLEN("../../00/00/"), "/", &saveptr); dir_name = strtok_r (NULL, "/", &saveptr); - strcat (dir_name, "/"); uuid_parse (pgfidstr, tmp_gfid); @@ -178,6 +177,7 @@ posix_make_ancestryfromgfid (xlator_t *this, char *path, int pathsize, inode = posix_resolve (this, itable, *parent, dir_name, &iabuf); + strcat (dir_name, "/"); ret = posix_make_ancestral_node (priv_base_path, path, pathsize, head, dir_name, &iabuf, inode, type, xdata); if (*parent != NULL) { |