summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-02-01 22:35:55 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-02 19:38:09 -0800
commit698c0750e5b93fb9aa842a1d70def9ecfa6da41c (patch)
tree35dcd2156eef1b846979ad4f433022736a31e16c
parent52c13660eec1dd38f71e7119b319209f8cfd84e8 (diff)
performanc/stat-prefetch: check if loc->gfid is present before checking loc->name
After gfid based backend changes loc will either contain the gfid of the inode or it will contain the parent gfid and the name of the entry. So before unwinding when loc->name is not there we have to check if loc->gfid is present or not. If loc->gfid is null and loc->name is also NULL, then unwind with the error. Change-Id: If88b9462bde09a80e79f27899c995605697ce453 BUG: 785675 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2710 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 827a9f99d28..a760e97a9a5 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -2189,9 +2189,11 @@ sp_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc)
this, out);
GF_VALIDATE_OR_GOTO (this->name, newloc, out);
GF_VALIDATE_OR_GOTO (this->name, newloc->path, out);
- GF_VALIDATE_OR_GOTO (this->name, newloc->name, out);
+ if (uuid_is_null (newloc->gfid))
+ GF_VALIDATE_OR_GOTO (this->name, newloc->name, out);
GF_VALIDATE_OR_GOTO (this->name, newloc->inode, out);
- GF_VALIDATE_OR_GOTO (this->name, oldloc->name, out);
+ if (uuid_is_null (oldloc->gfid))
+ GF_VALIDATE_OR_GOTO (this->name, oldloc->name, out);
ret = sp_cache_remove_parent_entry (frame, this, newloc->parent->table,
(char *)newloc->path);
@@ -2292,7 +2294,8 @@ sp_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset)
GF_VALIDATE_OR_GOTO (frame->this ? frame->this->name : "stat-prefetch",
this, out);
GF_VALIDATE_OR_GOTO (this->name, loc, out);
- GF_VALIDATE_OR_GOTO (this->name, loc->name, out);
+ if (uuid_is_null (loc->gfid))
+ GF_VALIDATE_OR_GOTO (this->name, loc->name, out);
sp_remove_caches_from_all_fds_opened (this, loc->parent,
(char *)loc->name);
@@ -2432,7 +2435,8 @@ sp_setattr (call_frame_t *frame, xlator_t *this,
GF_VALIDATE_OR_GOTO (frame->this ? frame->this->name : "stat-prefetch",
this, out);
GF_VALIDATE_OR_GOTO (this->name, loc, out);
- GF_VALIDATE_OR_GOTO (this->name, loc->name, out);
+ if (uuid_is_null (loc->gfid))
+ GF_VALIDATE_OR_GOTO (this->name, loc->name, out);
sp_remove_caches_from_all_fds_opened (this, loc->parent,
(char *)loc->name);
@@ -2531,7 +2535,8 @@ sp_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size)
GF_ASSERT (frame);
GF_VALIDATE_OR_GOTO ("stat-prefetch", this, out);
GF_VALIDATE_OR_GOTO (this->name, loc, out);
- GF_VALIDATE_OR_GOTO (this->name, loc->name, out);
+ if (uuid_is_null (loc->gfid))
+ GF_VALIDATE_OR_GOTO (this->name, loc->name, out);
sp_remove_caches_from_all_fds_opened (this, loc->parent,
(char *)loc->name);