summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNithya Balachandran <nbalacha@redhat.com>2014-09-04 14:05:04 -0400
committerVijay Bellur <vbellur@redhat.com>2014-09-09 10:45:19 -0700
commitd34029cceb290bda27357ca38238a714a0cba286 (patch)
tree8579ac9a9e3b8af2476e057fd4d2c8c858efc1f9
parent96c92dcba8b4b4dcd85230d76da05ad9b043c3cf (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: 1138387 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on-master: 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> Reviewed-on: http://review.gluster.org/8605 Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-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,