diff options
author | Sakshi Bansal <sabansal@redhat.com> | 2016-02-05 14:51:10 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-02-21 22:39:31 -0800 |
commit | f02dc88786afea06e6b064a724803c82a0af90ba (patch) | |
tree | a68fc9a2a34ce8a22d1917da515b2b4503338cfb /xlators/cluster/dht | |
parent | 46bd29e0f2a7fc9278068a06d12066d614f365ec (diff) |
dht: file rename must take blocking inode locks
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>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-rename.c | 10 |
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 5170fac0e97..132068d43e2 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -1185,7 +1185,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; } @@ -1221,13 +1221,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; } @@ -1303,8 +1303,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; |