diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-06-30 11:22:31 +0530 |
---|---|---|
committer | gluster-ant <bugzilla-bot@gluster.org> | 2015-06-30 11:22:31 +0530 |
commit | f0c6d021b820a79d242d10c17f3c8ced583e2c27 (patch) | |
tree | c61e269e72c5a5a42b177d0f07421d66ea96df92 | |
parent | 4880e919637e5f3127b9deee184d0fe1c1912a55 (diff) | |
download | glusterfs-f0c6d021b820a79d242d10c17f3c8ced583e2c27.tar.gz glusterfs-f0c6d021b820a79d242d10c17f3c8ced583e2c27.tar.xz glusterfs-f0c6d021b820a79d242d10c17f3c8ced583e2c27.zip |
ctr:Avoid assertion failure in lookup
in ctr_lookup, the loc variable need not be comes with pargfid,
though there is a parent for the inode. The same for loc->name
also. From this patch, we will generate loc->name from loc->path
Change-Id: I24a79554748139504ec09f77930f8208d3805977
BUG: 1236128
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/11459
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Joseph Fernandes
-rw-r--r-- | xlators/features/changetimerecorder/src/changetimerecorder.c | 16 | ||||
-rw-r--r-- | xlators/features/changetimerecorder/src/ctr-helper.h | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/xlators/features/changetimerecorder/src/changetimerecorder.c b/xlators/features/changetimerecorder/src/changetimerecorder.c index 703df496e9..7fd6258475 100644 --- a/xlators/features/changetimerecorder/src/changetimerecorder.c +++ b/xlators/features/changetimerecorder/src/changetimerecorder.c @@ -334,8 +334,8 @@ ctr_lookup (call_frame_t *frame, xlator_t *this, goto out; /*fill ctr link context*/ - FILL_CTR_LINK_CX(_link_cx, loc->pargfid, loc->name, - loc->path); + FILL_CTR_LINK_CX(_link_cx, loc->parent->gfid, loc->name, + loc->path, out); /* Fill ctr inode context*/ /* IA_IFREG : We assume its a file in the wind @@ -764,11 +764,11 @@ ctr_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, /*Fill old link context*/ FILL_CTR_LINK_CX(_olink_cx, oldloc->pargfid, oldloc->name, - oldloc->path); + oldloc->path, out); /*Fill new link context*/ FILL_CTR_LINK_CX(_nlink_cx, newloc->pargfid, newloc->name, - newloc->path); + newloc->path, out); /*Fill ctr inode context*/ FILL_CTR_INODE_CONTEXT(_inode_cx, oldloc->inode->ia_type, @@ -874,7 +874,7 @@ ctr_unlink (call_frame_t *frame, xlator_t *this, CTR_IS_DISABLED_THEN_GOTO(this, out); /*Fill link context*/ - FILL_CTR_LINK_CX(_link_cx, loc->pargfid, loc->name, loc->path); + FILL_CTR_LINK_CX(_link_cx, loc->pargfid, loc->name, loc->path, out); /*Fill ctr inode context*/ FILL_CTR_INODE_CONTEXT(_inode_cx, loc->inode->ia_type, @@ -1123,7 +1123,7 @@ ctr_mknod (call_frame_t *frame, xlator_t *this, gf_uuid_copy (gfid, uuid_req); /*fill ctr link context*/ - FILL_CTR_LINK_CX (_link_cx, loc->pargfid, loc->name, loc->path); + FILL_CTR_LINK_CX (_link_cx, loc->pargfid, loc->name, loc->path, out); /*Fill ctr inode context*/ FILL_CTR_INODE_CONTEXT (_inode_cx, loc->inode->ia_type, @@ -1212,7 +1212,7 @@ ctr_create (call_frame_t *frame, xlator_t *this, gf_uuid_copy (gfid, uuid_req); /*fill ctr link context*/ - FILL_CTR_LINK_CX(_link_cx, loc->pargfid, loc->name, loc->path); + FILL_CTR_LINK_CX(_link_cx, loc->pargfid, loc->name, loc->path, out); /*Fill ctr inode context*/ FILL_CTR_INODE_CONTEXT(_inode_cx, loc->inode->ia_type, @@ -1292,7 +1292,7 @@ ctr_link (call_frame_t *frame, xlator_t *this, /*fill ctr link context*/ FILL_CTR_LINK_CX(_link_cx, newloc->pargfid, newloc->name, - newloc->path); + newloc->path, out); /*Fill ctr inode context*/ FILL_CTR_INODE_CONTEXT(_inode_cx, oldloc->inode->ia_type, diff --git a/xlators/features/changetimerecorder/src/ctr-helper.h b/xlators/features/changetimerecorder/src/ctr-helper.h index 8fd16963a4..0c4f3e2cd8 100644 --- a/xlators/features/changetimerecorder/src/ctr-helper.h +++ b/xlators/features/changetimerecorder/src/ctr-helper.h @@ -180,12 +180,12 @@ do {\ } while (0) /*Clear and fill the ctr_link_context with values*/ -#define FILL_CTR_LINK_CX(ctr_link_cx, _pargfid, _basename, _basepath)\ +#define FILL_CTR_LINK_CX(ctr_link_cx, _pargfid, _basename, _basepath, label)\ do {\ - GF_ASSERT (ctr_link_cx);\ - GF_ASSERT (_pargfid);\ - GF_ASSERT (_basename);\ - GF_ASSERT (_basepath);\ + GF_VALIDATE_OR_GOTO ("ctr", ctr_link_cx, label);\ + GF_VALIDATE_OR_GOTO ("ctr", _pargfid, label);\ + GF_VALIDATE_OR_GOTO ("ctr", _basename, label);\ + GF_VALIDATE_OR_GOTO ("ctr", _basepath, label);\ memset (ctr_link_cx, 0, sizeof (*ctr_link_cx));\ ctr_link_cx->pargfid = &_pargfid;\ ctr_link_cx->basename = _basename;\ |