From bbde491b47f240836d454585d10c5623aef45662 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Thu, 25 Jun 2015 16:30:40 +0530 Subject: EC : While Healing a file, set the config xattr Problem : trusted.ec.config attr was missing for the healed file Solution: Writing trusted.ec.config while healing a file. Change-Id: I340dd45ff8ab5bc1cd6e9b0cd2b2ded236e5acf0 BUG: 1235629 Signed-off-by: Ashish Pandey Reviewed-on: http://review.gluster.org/11415 Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System --- xlators/cluster/ec/src/ec-heal.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index af75c9551b8..c2b8e117045 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -2328,7 +2328,7 @@ ec_create_name (call_frame_t *frame, ec_t *ec, inode_t *parent, char *name, unsigned char *create = NULL; dict_t *xdata = NULL; char *linkname = NULL; - + ec_config_t config; /* There should be just one gfid key */ EC_REPLIES_ALLOC (replies, ec->nodes); if (gfid_db->count != 1) { @@ -2422,6 +2422,19 @@ ec_create_name (call_frame_t *frame, ec_t *ec, inode_t *parent, char *name, if (output1[i]) output[i] = 1; break; + case IA_IFREG: + config.version = EC_CONFIG_VERSION; + config.algorithm = EC_CONFIG_ALGORITHM; + config.gf_word_size = EC_GF_BITS; + config.bricks = ec->nodes; + config.redundancy = ec->redundancy; + config.chunk_size = EC_METHOD_CHUNK_SIZE; + + if (ec_dict_set_config(xdata, EC_XATTR_CONFIG, + &config) < 0) { + ret = -EIO; + goto out; + } default: ret = dict_set_int32 (xdata, GLUSTERFS_INTERNAL_FOP_KEY, 1); -- cgit