summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2015-06-25 16:30:40 +0530
committerXavier Hernandez <xhernandez@datalab.es>2015-06-26 08:28:33 -0700
commit6d3b289f8b9b30bca390e72b256aa161e3f65eb5 (patch)
treeb7f34d97996a49907e99510371c9cd04d8bbbe00 /xlators
parent3925f5cf33df85807db812211552fc16c7850d0d (diff)
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: 1235246 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/11407 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-heal.c15
1 files changed, 14 insertions, 1 deletions
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);