From b2a5eed9b17a82ec4b6366b0107fe2271328c16a 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 --- xlators/cluster/ec/src/ec-heald.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'xlators/cluster/ec') diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c index 2e5098a3612..0e8076826c6 100644 --- a/xlators/cluster/ec/src/ec-heald.c +++ b/xlators/cluster/ec/src/ec-heald.c @@ -137,10 +137,8 @@ ec_shd_inode_find (xlator_t *this, xlator_t *subvol, *inode = NULL; *inode = inode_find (this->itable, gfid); - if (*inode) { - inode_lookup (*inode); + if (*inode) goto out; - } loc.inode = inode_new (this->itable); if (!loc.inode) { @@ -157,8 +155,6 @@ ec_shd_inode_find (xlator_t *this, xlator_t *subvol, if (!*inode) { ret = -ENOMEM; goto out; - } else { - inode_lookup (*inode); } out: loc_wipe (&loc); @@ -267,8 +263,6 @@ out: uuid_utoa(loc.gfid)); ec_shd_index_purge (subvol, parent->inode, entry->d_name); } - if (loc.inode) - inode_forget (loc.inode, 0); loc_wipe (&loc); return 0; @@ -296,8 +290,6 @@ ec_shd_index_sweep (struct subvol_healer *healer) ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_SELF_HEALD, healer, ec_shd_index_heal); out: - if (loc.inode) - inode_forget (loc.inode, 0); loc_wipe (&loc); return ret; @@ -336,8 +328,6 @@ ec_shd_full_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent, ret = 0; out: - if (loc.inode) - inode_forget (loc.inode, 0); loc_wipe (&loc); return ret; } -- cgit