From 50063ea7f4182ed30b86f38a716d03464e07b8c6 Mon Sep 17 00:00:00 2001 From: Ashish Pandey Date: Tue, 21 Apr 2015 17:22:40 +0530 Subject: cluster/ec: add separate versions for data/entry, metadata Adding 64 bits in "version" key of extended attributes. First 64 bits (Left) represents Data version. Last 64 bits (right) represents Meta Data version. Note: 3.7 and 3.6 version ec can't co-exist with this change because xattrop in 3.6 will fail with ERANGE as the buffer passed to it will be '8' bytes where as the value will be 16 bytes in 3.7. Where as 3.7 version clients can work with old version files. For upgrades we need to tell users to complete heals and then upgrade BUG: 1215265 Change-Id: Ib85114680cb7e75b8371c984d9f7b6401c1ffb93 Signed-off-by: Ashish Pandey Reviewed-on: http://review.gluster.org/10312 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri --- xlators/cluster/ec/src/ec-generic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/ec/src/ec-generic.c') diff --git a/xlators/cluster/ec/src/ec-generic.c b/xlators/cluster/ec/src/ec-generic.c index fdab9ec2ae9..4cf5a50ecbd 100644 --- a/xlators/cluster/ec/src/ec-generic.c +++ b/xlators/cluster/ec/src/ec-generic.c @@ -717,7 +717,8 @@ void ec_lookup_rebuild(ec_t * ec, ec_fop_data_t * fop, ec_cbk_data_t * cbk) return; } - ec_dict_del_number(cbk->xdata, EC_XATTR_VERSION, &cbk->version); + ec_dict_del_array(cbk->xdata, EC_XATTR_VERSION, + cbk->version, EC_VERSION_SIZE); if (ec_loc_update(fop->xl, &fop->loc[0], cbk->inode, &cbk->iatt[0]) != 0) { cbk->op_ret = -1; @@ -732,7 +733,8 @@ void ec_lookup_rebuild(ec_t * ec, ec_fop_data_t * fop, ec_cbk_data_t * cbk) if ((ctx != NULL) && (ctx->inode_lock != NULL)) { lock = ctx->inode_lock; - cbk->version = lock->version; + cbk->version[0] = lock->version[0]; + cbk->version[1] = lock->version[1]; if (lock->have_size) { size = lock->size; -- cgit