summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2015-06-25 16:30:40 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-06-26 02:18:44 -0700
commitbbde491b47f240836d454585d10c5623aef45662 (patch)
treeed82d2f90fcd102481cf39e3f2be8c88b3c2d449 /xlators
parent84396c9834a83b73f6b689d078bb206667cc3f3f (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: 1235629 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/11415 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
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);