From d3a93ff7a9a8d102cc13063dec33dd652d69d719 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 31 May 2016 21:51:22 +0530 Subject: features/index: Exclude gfid-type for '.', '..' index_get_gfid_type is assuming all names are gfids where as some of these entry->d_names can be '.' or '..' Thanks a lot to Nithya for RC >BUG: 1336630 >Change-Id: I06ad688a5865ab25b4f6c8a91af8c7fb2ed62186 >Signed-off-by: Pranith Kumar K >Reviewed-on: http://review.gluster.org/14589 >Smoke: Gluster Build System >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Ravishankar N >Reviewed-by: Krutika Dhananjay >(cherry picked from commit a89a9d266c439800286f281655d67f4e362dec32) Change-Id: I2a3d13ee76846c38e965f8a98bacc8755a8debfd BUG: 1341482 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/14598 Smoke: Gluster Build System Reviewed-by: Krutika Dhananjay NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Tested-by: Oleksandr Natalenko --- xlators/features/index/src/index.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 84c22c072b4..5d59b22aed5 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1199,9 +1199,16 @@ index_get_gfid_type (void *opaque) int ret = 0; list_for_each_entry (entry, &args->entries->list, list) { + if (strcmp (entry->d_name, ".") == 0 || + strcmp (entry->d_name, "..") == 0) + continue; + loc_wipe (&loc); - gf_uuid_parse (entry->d_name, loc.gfid); + entry->d_type = IA_INVAL; + if (gf_uuid_parse (entry->d_name, loc.gfid)) + continue; + loc.inode = inode_find (args->parent->table, loc.gfid); if (loc.inode) { entry->d_type = loc.inode->ia_type; -- cgit