diff options
author | Susant Palai <spalai@redhat.com> | 2014-05-09 00:39:10 -0400 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-05-28 10:48:53 -0700 |
commit | 58b9edee87bba3ffe812cf15f171926be017575b (patch) | |
tree | 1c07aa7c241e7c36fed4273a72c49a48c5ac51cf | |
parent | deaaaec82a0aae1edfeb0688e20498fafa896c83 (diff) |
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 <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/7733
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/storage/posix/src/posix.c | 7 |
1 files changed, 5 insertions, 2 deletions
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); |