From acd2292f085b15c2c5c28169d11f20dca90f5ec9 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Tue, 25 Mar 2014 23:58:50 +0000 Subject: nsr: expand coverage of reconciliation test This version tests eight kinds of modifying operations instead of just two, and tests those two a bit better than before. Symlink had to be fixed because there was a mismatch between the actual changelog format and the nsr-recon parsing code. Setxattr and removexattr are still hopelessly broken, but that code needs to be replaced anyway when we start putting the xattr names into the changelog so it's not worth fixing them right now. When that's done we'll be up to ten kinds of operations, missing only rename. Change-Id: I3d805cf8fd324221be03edc3e5fc26d7656e4af9 Signed-off-by: Jeff Darcy --- xlators/cluster/nsr-recon/src/recon_xlator.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'xlators/cluster/nsr-recon') diff --git a/xlators/cluster/nsr-recon/src/recon_xlator.c b/xlators/cluster/nsr-recon/src/recon_xlator.c index ffbf74296..272c35dc2 100644 --- a/xlators/cluster/nsr-recon/src/recon_xlator.c +++ b/xlators/cluster/nsr-recon/src/recon_xlator.c @@ -391,19 +391,19 @@ gf_boolean_t nsr_recon_libchangelog_get_records(xlator_t *this, char *bp, int32_ } rec->gfid[i] = '\0'; - if (opcode == GF_FOP_SYMLINK) { - // the symlink would have been removed. Hence ignore this. - // TBD - have an uniform error policy in case of such cases. - // Right now we are handling some on the source and some on the destination. - if(get_link_using_gfid(this->private, rec->gfid, rec->link_path) == _gf_false) { - rec->type = NSR_LOG_HOLE; - goto finish; - } - } - GF_ASSERT(*start == 0); start ++; + if (opcode == GF_FOP_SYMLINK) { + i = 0; + do { + if (i >= 256) { + goto finish; + } + rec->link_path[i++] = *start; + } while (*(start++) != '\0'); + } + i = 0; // If type is fop_gfid_offset+_len, get offset if ((type == fop_gfid_offset) || (type == fop_gfid_offset_len)) { -- cgit