summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heald.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heald.c')
-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)