summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorSakshi Bansal <sabansal@redhat.com>2016-02-05 14:51:10 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-02-22 10:12:07 -0800
commite01a7c50a0fe4ea2a70144b4405359a4fe0a27b0 (patch)
tree7a7ccc809f8ced85285c026fcbd2611d47c1a44d /xlators/cluster
parent235237e5a968261df3d34f969d909550a6b74b77 (diff)
dht: file rename must take blocking inode locks
Backport of http://review.gluster.org/#/c/13366 Currently DHT takes non-blocking locks for file rename. Due to this during parallel renames some clients fail with EBUSY or ESTALE errors. Hence to avoid application discontinuity file rename must take blocking inode locks. > Change-Id: I986e9d08b3be359f20b1a3e1564e049b0f3dffd3 > BUG: 1304966 > Signed-off-by: Sakshi Bansal <sabansal@redhat.com> > Reviewed-on: http://review.gluster.org/13366 > Smoke: Gluster Build System <jenkins@build.gluster.com> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.com> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Change-Id: I986e9d08b3be359f20b1a3e1564e049b0f3dffd3 BUG: 1310544 Signed-off-by: Sakshi Bansal <sabansal@redhat.com> Reviewed-on: http://review.gluster.org/13481 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-rename.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index 0f8f6b2ddd5..817f2bf15ac 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -1191,7 +1191,7 @@ dht_rename_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (is_last_call (call_cnt)) {
if (local->is_linkfile) {
local->op_ret = -1;
- local->op_errno = EBUSY;
+ local->op_errno = op_errno;
goto fail;
}
@@ -1227,13 +1227,13 @@ dht_rename_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
gf_msg (this->name, GF_LOG_WARNING, op_errno,
DHT_MSG_INODE_LK_ERROR,
"acquiring inodelk failed "
- "rename (%s:%s:%s %s:%s:%s), returning EBUSY",
+ "rename (%s:%s:%s %s:%s:%s)",
local->loc.path, src_gfid, local->src_cached->name,
local->loc2.path, dst_gfid,
local->dst_cached ? local->dst_cached->name : NULL);
local->op_ret = -1;
- local->op_errno = (op_errno == EAGAIN) ? EBUSY : op_errno;
+ local->op_errno = op_errno;
goto done;
}
@@ -1309,8 +1309,8 @@ dht_rename_lock (call_frame_t *frame)
local->lock.locks = lk_array;
local->lock.lk_count = count;
- ret = dht_nonblocking_inodelk (frame, lk_array, count,
- dht_rename_lock_cbk);
+ ret = dht_blocking_inodelk (frame, lk_array, count,
+ dht_rename_lock_cbk);
if (ret < 0) {
local->lock.locks = NULL;
local->lock.lk_count = 0;