summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorNithya Balachandran <nbalacha@redhat.com>2014-07-21 18:46:14 +0530
committerVijay Bellur <vbellur@redhat.com>2014-07-30 02:19:17 -0700
commitdf770496ba5ed6d2c72bcfc76ca9e816a08c383a (patch)
tree8ad00df7492d1bb8a9f72ee37df7f5524ab388e3 /xlators
parent45fbf99cb669e891a84a8228cef27973f5e774bf (diff)
dht: fix rename race
Additional check to check if we created the linkto file before deleting it in the rename cleanup function Change-Id: I919cd7cb24f948ba4917eb9cf50d5169bb730a67 BUG: 1117851 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/8338 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/dht/src/dht-rename.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index 037f8731fcf..3b023343231 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -439,8 +439,10 @@ dht_rename_cleanup (call_frame_t *frame)
if (src_cached == dst_cached)
goto nolinks;
- if (dst_hashed != src_hashed && dst_hashed != src_cached)
+ if (local->linked && (dst_hashed != src_hashed )&&
+ (dst_hashed != src_cached)) {
call_cnt++;
+ }
if (local->added_link && (src_cached != dst_hashed)) {
call_cnt++;
@@ -455,7 +457,8 @@ dht_rename_cleanup (call_frame_t *frame)
uuid_unparse(local->loc.inode->gfid, gfid);
- if (dst_hashed != src_hashed && dst_hashed != src_cached) {
+ if (local->linked && (dst_hashed != src_hashed) &&
+ (dst_hashed != src_cached)) {
dict_t *xattr_new = NULL;
gf_msg_trace (this->name, 0,