diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2015-06-08 11:36:12 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-06-18 23:38:01 -0700 |
commit | d86a238f29c1519bad37bd38d12227bd69d1947f (patch) | |
tree | 1d790d15d935e397fd5977e77d8ab901550038e8 /xlators | |
parent | 83778a592f75ef18ce5e22e14adc9bf118705a17 (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: I81723567af824ce4a9fa37e309eeeab8404ac71e
BUG: 1233036
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/11309
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 13825e1ebad..7f5095e2ada 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -178,6 +178,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; @@ -193,7 +200,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; } |