From 20300fa96802ec6a0cd17edba38baf9639561d55 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Mon, 28 Mar 2016 16:31:12 +0530 Subject: 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 >Reviewed-on: http://review.gluster.org/13834 >Smoke: Gluster Build System >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Anuradha Talur BUG: 1327864 Change-Id: I3507ed88cd75e069ed302525bfa259cf407871fb Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/14009 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/cluster/afr/src/afr-self-heald.c | 7 +------ 1 file changed, 1 insertion(+), 6 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 1da3cb92b43..21b13b7e6fc 100644 --- a/xlators/cluster/afr/src/afr-self-heald.c +++ b/xlators/cluster/afr/src/afr-self-heald.c @@ -164,10 +164,8 @@ afr_shd_inode_find (xlator_t *this, xlator_t *subvol, uuid_t gfid) struct iatt iatt = {0, }; inode = inode_find (this->itable, gfid); - if (inode) { - inode_lookup (inode); + if (inode) goto out; - } loc.inode = inode_new (this->itable); if (!loc.inode) @@ -179,8 +177,6 @@ afr_shd_inode_find (xlator_t *this, xlator_t *subvol, uuid_t gfid) goto out; inode = inode_link (loc.inode, NULL, NULL, &iatt); - if (inode) - inode_lookup (inode); out: loc_wipe (&loc); return inode; @@ -449,7 +445,6 @@ afr_shd_index_sweep (struct subvol_healer *healer, char *vgfid) ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_SELF_HEALD, healer, afr_shd_index_heal); - inode_forget (loc.inode, 1); loc_wipe (&loc); if (ret == 0) -- cgit