From 58b9edee87bba3ffe812cf15f171926be017575b Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Fri, 9 May 2014 00:39:10 -0400 Subject: Posix/readdirp : Avoid filling wrong stat info for dentry in readdirp Problem: Upon no entry found for a dentry, posix_readdirp_fill used to fill the stat for the current entry with the previous one. Solution: Continue with other entries if lstat failed for current one Change-Id: Ic96b5900451ed6c8de59acf9fee2e116649d3cdb BUG: 1096578 Signed-off-by: Susant Palai Reviewed-on: http://review.gluster.org/7733 Reviewed-by: Raghavendra G Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/storage/posix/src/posix.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 825715e71ba..35e34c4bec6 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -4820,7 +4820,7 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic int len = 0; struct iatt stbuf = {0, }; uuid_t gfid; - + int ret = -1; if (list_empty(&entries->list)) return 0; @@ -4841,7 +4841,10 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic strcpy (&hpath[len+1], entry->d_name); - posix_pstat (this, gfid, hpath, &stbuf); + ret = posix_pstat (this, gfid, hpath, &stbuf); + + if (ret == -1) + continue; if (!inode) inode = inode_find (itable, stbuf.ia_gfid); -- cgit