summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-06-08 11:36:12 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-06-17 03:21:11 -0700
commitdb3a86b6d1a3a0c50450e2e30a6f7648f0fa94db (patch)
tree240a393dc535b881ee2b9669209868c7ce3764e5
parent5c5ae2f29e32d701310407f78fcdbc62da127e95 (diff)
cluster/afr: Do not attempt entry self-heal if the last lookup on entry failed on src
Backport of: http://review.gluster.org/11119 Test bug-948686.t was causing shd to dump core due to gfid being NULL. This was due to the volume being stopped while index heal's in progress, causing afr_selfheal_unlocked_lookup_on() to fail sometimes on the src brick with ENOTCONN. And when afr_selfheal_newentry_mark() copies the gfid off the src iatt, it essentially copies null gfid. This was causing the assertion as part of xattrop in protocol/client to fail. Change-Id: I5e6e3f00bc1a98cad7fd55cc3a6459d60ec8b0fe BUG: 1229550 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11131 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index cb3648c07bd..ab210b37bef 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -181,6 +181,13 @@ __afr_selfheal_heal_dirent (call_frame_t *frame, xlator_t *this, fd_t *fd,
if (!replies[source].valid)
return -EIO;
+ /* Skip healing this entry if the last lookup on it failed for reasons
+ * other than ENOENT.
+ */
+ if ((replies[source].op_ret < 0) &&
+ (replies[source].op_errno != ENOENT))
+ return -replies[source].op_errno;
+
for (i = 0; i < priv->child_count; i++) {
if (!healed_sinks[i])
continue;
@@ -188,7 +195,7 @@ __afr_selfheal_heal_dirent (call_frame_t *frame, xlator_t *this, fd_t *fd,
replies[source].op_errno == ENOENT) {
ret = afr_selfheal_entry_delete (this, fd->inode, name,
inode, i, replies);
- } else {
+ } else {
if (!gf_uuid_compare (replies[i].poststat.ia_gfid,
replies[source].poststat.ia_gfid))
continue;
@@ -196,7 +203,7 @@ __afr_selfheal_heal_dirent (call_frame_t *frame, xlator_t *this, fd_t *fd,
ret = afr_selfheal_recreate_entry (this, i, source,
fd->inode, name, inode,
replies, newentry);
- }
+ }
if (ret < 0)
break;
}