From a327b9fa9d50a66e7bb3a887ac569be914132d10 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sun, 26 Apr 2015 14:28:00 +0530 Subject: cluster/ec: Change meaning of trusted.ec.dirty - With this change, the xattr will represent if the file needs to be healed or not. It will have different values for data/entry and metadata changes. - inode ref leaks and dict_set_dynstr related leaks fixed - Added support for trylock/lock based on heal-cmd execution or not in data heal. - Made fixes to pass regression runs Change-Id: I9d8def4c2badde18a76b7898816fecfac113737a BUG: 1216303 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/10385 Reviewed-on: http://review.gluster.org/10693 Tested-by: NetBSD Build System Tested-by: Gluster Build System --- xlators/cluster/ec/src/ec-heald.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'xlators/cluster/ec/src/ec-heald.c') diff --git a/xlators/cluster/ec/src/ec-heald.c b/xlators/cluster/ec/src/ec-heald.c index 53b3996590c..a7cf8f7bd30 100644 --- a/xlators/cluster/ec/src/ec-heald.c +++ b/xlators/cluster/ec/src/ec-heald.c @@ -18,7 +18,7 @@ #include "syncop-utils.h" #include "protocol-common.h" -#define SHD_INODE_LRU_LIMIT 2048 +#define SHD_INODE_LRU_LIMIT 10 #define ASSERT_LOCAL(this, healer) \ do { \ if (!ec_shd_is_subvol_local (this, healer->subvol)) { \ @@ -224,8 +224,8 @@ ec_shd_index_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent, void *data) { struct subvol_healer *healer = data; - ec_t *ec = NULL; - loc_t loc = {0}; + ec_t *ec = NULL; + loc_t loc = {0}; int ret = 0; ec = healer->this->private; @@ -254,6 +254,8 @@ ec_shd_index_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent, ec_shd_selfheal (healer, healer->subvol, &loc); out: + if (loc.inode) + inode_forget (loc.inode, 0); loc_wipe (&loc); return 0; @@ -280,7 +282,7 @@ ec_shd_index_sweep (struct subvol_healer *healer) ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_AFR_SELF_HEALD, healer, ec_shd_index_heal); - inode_forget (loc.inode, 1); + inode_forget (loc.inode, 0); loc_wipe (&loc); return ret; @@ -318,10 +320,12 @@ ec_shd_full_heal (xlator_t *subvol, gf_dirent_t *entry, loc_t *parent, ec_shd_selfheal (healer, healer->subvol, &loc); - loc_wipe (&loc); ret = 0; out: + if (loc.inode) + inode_forget (loc.inode, 0); + loc_wipe (&loc); return ret; } -- cgit