summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-06-04 23:23:45 +0530
committerAnand Avati <avati@redhat.com>2012-06-05 00:53:59 -0700
commite57280a9470cb21750954a740b3aa94929321ae9 (patch)
treead01b1cec7e192815cc8c351f1364392a36d97df /xlators/cluster/afr
parent7c73a25a78774bfbca9fbbafb7ead2dffafaa5b1 (diff)
Self-heald: inode_link files while crawling
Change-Id: I559a3ff507b9487b1dfca7871c188a05d89ea6d6 BUG: 826580 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3515 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-self-heald.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c
index 1a749249056..575bf4361d2 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)