From e57280a9470cb21750954a740b3aa94929321ae9 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 4 Jun 2012 23:23:45 +0530 Subject: Self-heald: inode_link files while crawling Change-Id: I559a3ff507b9487b1dfca7871c188a05d89ea6d6 BUG: 826580 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3515 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr-self-heald.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heald.c') diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c index 1a7492490..575bf4361 100644 --- a/xlators/cluster/afr/src/afr-self-heald.c +++ b/xlators/cluster/afr/src/afr-self-heald.c @@ -683,6 +683,7 @@ afr_crawl_build_start_loc (xlator_t *this, afr_crawl_data_t *crawl_data, struct iatt parent = {0}; int ret = 0; xlator_t *readdir_xl = crawl_data->readdir_xl; + inode_t *link_inode = NULL; priv = this->private; if (crawl_data->crawl == FULL) { @@ -718,7 +719,8 @@ afr_crawl_build_start_loc (xlator_t *this, afr_crawl_data_t *crawl_data, } goto out; } - inode_link (dirloc->inode, NULL, NULL, &iattr); + link_inode = inode_link (dirloc->inode, NULL, NULL, &iattr); + inode_unref (link_inode); } ret = 0; out: @@ -833,10 +835,7 @@ _process_entries (xlator_t *this, loc_t *parentloc, gf_dirent_t *entries, ret = crawl_data->process_entry (this, crawl_data, entry, &entry_loc, parentloc, &iattr); - if (crawl_data->crawl == INDEX) - continue; - - if (ret || !IA_ISDIR (iattr.ia_type)) + if (ret) continue; link_inode = inode_link (entry_loc.inode, NULL, NULL, &iattr); @@ -846,7 +845,13 @@ _process_entries (xlator_t *this, loc_t *parentloc, gf_dirent_t *entries, ret = -1; goto out; } + inode_unref (link_inode); + if (crawl_data->crawl == INDEX) + continue; + + if (!IA_ISDIR (iattr.ia_type)) + continue; fd = NULL; ret = afr_crawl_opendir (this, crawl_data, &fd, &entry_loc); if (ret) -- cgit