summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-08-04 16:23:46 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-09-17 13:38:22 +0000
commitd43ef3d4dd2b8c2fcf16da541626a9bf63573a88 (patch)
tree06570139ca3ad1e5a1855d0ce006060ec231c64d /xlators
parentd3b0205dbd299ff69883133ce22ca9d0623e87e2 (diff)
afr: Prevent null gfids in self-heal entry re-creation
> Reviewed-on: https://review.gluster.org/17981 > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Amar Tumballi <amarts@redhat.com> > Reviewed-by: Karthik U S <ksubrahm@redhat.com> (cherry picked from commit bead74a6e085001225bc0704bad1a5db36dd75a1) Change-Id: I5acb8bd0a19fc4e764d61e349bb690b5236ee610 BUG: 1491985 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: https://review.gluster.org/18300 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index 413425ccad9..091cd6aebe1 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -84,10 +84,20 @@ afr_selfheal_recreate_entry (call_frame_t *frame, int dst, int source,
unsigned char *newentry = NULL;
priv = this->private;
+ iatt = &replies[source].poststat;
+ if (iatt->ia_type == IA_INVAL || gf_uuid_is_null (iatt->ia_gfid)) {
+ gf_msg (this->name, GF_LOG_ERROR, 0, AFR_MSG_SELF_HEAL_FAILED,
+ "Invalid ia_type (%d) or gfid(%s). source brick=%d, "
+ "pargfid=%s, name=%s", iatt->ia_type,
+ uuid_utoa(iatt->ia_gfid), source,
+ uuid_utoa(dir->gfid), name);
+ ret = -EINVAL;
+ goto out;
+ }
+
xdata = dict_new();
if (!xdata)
return -ENOMEM;
-
newentry = alloca0 (priv->child_count);
loc.parent = inode_ref (dir);
gf_uuid_copy (loc.pargfid, dir->gfid);
@@ -103,8 +113,6 @@ afr_selfheal_recreate_entry (call_frame_t *frame, int dst, int source,
if (ret)
goto out;
- iatt = &replies[source].poststat;
-
srcloc.inode = inode_ref (inode);
gf_uuid_copy (srcloc.gfid, iatt->ia_gfid);
if (iatt->ia_type != IA_IFDIR)