summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-03-28 16:31:12 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-03-31 05:46:32 -0700
commitb2a5eed9b17a82ec4b6366b0107fe2271328c16a (patch)
tree044ae61060c37e7a1885b033b8999dbd5be8a6a6 /xlators/cluster/afr/src/afr-common.c
parent16a3f0d020d23978b22a07354c25c654c88163a2 (diff)
cluster/afr: Don't lookup/forget inodes
Problem: All inodes that are looked-up are always forgotten without fail in afr removing the benefits of them being in lru. This same code can cause crashes if between inode_lookup, inode_forget in afr if the top xlator does inode_forget(0). Fix: Don't use lookup/forget in afr. No benefits are there at the moment for keeping this code. It is impossible to prevent top xlators to do inode_forget(0). Found similar instances in ec and removed them even though those code paths are not going to be executed in any place other than heal-daemon. BUG: 1321554 Change-Id: Ia4cb236178f7f129cc898d53f0bbd26f494a2a8d Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/13834 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anuradha Talur <atalur@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 8c04cfbff2f..f4d74c57a5d 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -1948,12 +1948,11 @@ afr_lookup_sh_metadata_wrap (void *opaque)
if (first == -1)
goto out;
- inode = afr_inode_link (local->inode,&replies[first].poststat);
+ inode = inode_link (local->inode, NULL, NULL, &replies[first].poststat);
if(!inode)
goto out;
afr_selfheal_metadata (frame, this, inode);
- inode_forget (inode, 1);
inode_unref (inode);
afr_local_replies_wipe (local, this->private);
@@ -4834,10 +4833,8 @@ out:
AFR_STACK_UNWIND (getxattr, frame, ret, op_errno, dict, NULL);
if (dict)
dict_unref (dict);
- if (inode) {
- inode_forget (inode, 1);
+ if (inode)
inode_unref (inode);
- }
GF_FREE (substr);
return ret;
}