From a9cbdd2916ab6851d108833e30536c02bf502f17 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 14 Sep 2010 06:31:10 +0000 Subject: posix: fix an issue with existing data in case of readdir Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1597 (readdirp fails if there is old data in the subvolumes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1597 --- xlators/storage/posix/src/posix.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 482a66e169c..551c93f6660 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -258,7 +258,7 @@ posix_lstat_with_gfid (xlator_t *this, const char *path, struct iatt *stbuf_p) ret = posix_fill_gfid_path (this, path, &stbuf); if (ret) - gf_log (this->name, GF_LOG_DEBUG, "failed to set gfid"); + gf_log (this->name, GF_LOG_DEBUG, "failed to get gfid"); if (stbuf_p) *stbuf_p = stbuf; @@ -3968,9 +3968,12 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this, */ if ((whichop == GF_FOP_READDIRP) || (priv->span_devices)) { strcpy (entry_path + real_path_len + 1, entry->d_name); - op_ret = posix_lstat_with_gfid (this, entry_path, &stbuf); - if (-1 == op_ret) - continue; + /* Don't check for return value of below function. + * because, if there is some data already existing, + * (before gfid changes), this function fails to fill + * gfid info (but gets the 'struct iatt' properly). + */ + posix_lstat_with_gfid (this, entry_path, &stbuf); } else stbuf.ia_ino = entry->d_ino; -- cgit