diff options
Diffstat (limited to 'xlators/cluster/ec/src/ec-helpers.c')
| -rw-r--r-- | xlators/cluster/ec/src/ec-helpers.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xlators/cluster/ec/src/ec-helpers.c b/xlators/cluster/ec/src/ec-helpers.c index dec39b9d2aa..48f54475e01 100644 --- a/xlators/cluster/ec/src/ec-helpers.c +++ b/xlators/cluster/ec/src/ec-helpers.c @@ -10,7 +10,7 @@ #include <libgen.h> -#include "byte-order.h" +#include <glusterfs/byte-order.h> #include "ec.h" #include "ec-mem-types.h" @@ -476,7 +476,7 @@ out: int32_t ec_loc_setup_path(xlator_t *xl, loc_t *loc) { - uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + static uuid_t root = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; char *name; int32_t ret = -EINVAL; @@ -717,6 +717,7 @@ __ec_inode_get(inode_t *inode, xlator_t *xl) memset(ctx, 0, sizeof(*ctx)); INIT_LIST_HEAD(&ctx->heal); INIT_LIST_HEAD(&ctx->stripe_cache.lru); + ctx->heal_count = 0; value = (uint64_t)(uintptr_t)ctx; if (__inode_ctx_set(inode, xl, &value) != 0) { GF_FREE(ctx); @@ -752,6 +753,7 @@ __ec_fd_get(fd_t *fd, xlator_t *xl) { int i = 0; ec_fd_t *ctx = NULL; + ec_inode_t *ictx = NULL; uint64_t value = 0; ec_t *ec = xl->private; @@ -774,6 +776,12 @@ __ec_fd_get(fd_t *fd, xlator_t *xl) GF_FREE(ctx); return NULL; } + /* Only refering bad-version so no need for lock + * */ + ictx = __ec_inode_get(fd->inode, xl); + if (ictx) { + ctx->bad_version = ictx->bad_version; + } } } else { ctx = (ec_fd_t *)(uintptr_t)value; |
