|
|
d1681e |
From c5401605f80c2630e39b283f10b7da92ff777863 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Susant Palai <spalai@redhat.com>
|
|
|
d1681e |
Date: Fri, 27 Apr 2018 16:40:02 +0530
|
|
|
d1681e |
Subject: [PATCH 251/260] dht: gf_defrag_settle_hash should ignore ENOENT and
|
|
|
d1681e |
ESTALE error
|
|
|
d1681e |
|
|
|
d1681e |
Problem: A directory deletion can happen just before gf_defrag_settle_hash
|
|
|
d1681e |
which internally does a setxattr operation on a directory.
|
|
|
d1681e |
|
|
|
d1681e |
Solution: Ignore ENOENT and ESTALE errors
|
|
|
d1681e |
|
|
|
d1681e |
> Fixes: bz#1572581
|
|
|
d1681e |
> Change-Id: I2f91809f3b5e02976c4c3a5a596406a8b2f8f6f2
|
|
|
d1681e |
> Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
d1681e |
(cherry picked from commit e2fda098112803bf651c4795952376cb8c1ad204)
|
|
|
d1681e |
|
|
|
d1681e |
upstream patch: https://review.gluster.org/#/c/19945/
|
|
|
d1681e |
|
|
|
d1681e |
BUG: 1572585
|
|
|
d1681e |
Change-Id: I2f91809f3b5e02976c4c3a5a596406a8b2f8f6f2
|
|
|
d1681e |
Signed-off-by: Susant Palai <spalai@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/137527
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Nithya Balachandran <nbalacha@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
xlators/cluster/dht/src/dht-rebalance.c | 9 ++++++++-
|
|
|
d1681e |
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
|
|
|
d1681e |
index eee00b8..51af11c 100644
|
|
|
d1681e |
--- a/xlators/cluster/dht/src/dht-rebalance.c
|
|
|
d1681e |
+++ b/xlators/cluster/dht/src/dht-rebalance.c
|
|
|
d1681e |
@@ -3493,8 +3493,15 @@ gf_defrag_settle_hash (xlator_t *this, gf_defrag_info_t *defrag,
|
|
|
d1681e |
|
|
|
d1681e |
ret = syncop_setxattr (this, loc, fix_layout, 0, NULL, NULL);
|
|
|
d1681e |
if (ret) {
|
|
|
d1681e |
- gf_log (this->name, GF_LOG_ERROR,
|
|
|
d1681e |
+ gf_msg (this->name, GF_LOG_ERROR, -ret,
|
|
|
d1681e |
+ DHT_MSG_LAYOUT_FIX_FAILED,
|
|
|
d1681e |
"fix layout on %s failed", loc->path);
|
|
|
d1681e |
+
|
|
|
d1681e |
+ if (-ret == ENOENT || -ret == ESTALE) {
|
|
|
d1681e |
+ /* Dir most likely is deleted */
|
|
|
d1681e |
+ return 0;
|
|
|
d1681e |
+ }
|
|
|
d1681e |
+
|
|
|
d1681e |
return -1;
|
|
|
d1681e |
}
|
|
|
d1681e |
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|