summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-rename.c
diff options
context:
space:
mode:
authorSakshi <sabansal@redhat.com>2015-07-16 14:31:03 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-27 06:25:34 -0700
commit9e51aa646fdc5840b6fa9b12b35c5cc2af274c3c (patch)
treea7ff968e51340b9e590805bc721fd8ae43c4b3ad /xlators/cluster/dht/src/dht-rename.c
parentcf3d6f14ae031ba2f5269cea6dbf80e60d00cce5 (diff)
dht : lock on subvols to prevent lookup vs rmdir race
There is a possibility that while an rmdir is completed on some non-hashed subvol and proceeding to others. A lookup selfheal can recreate the same directory on those subvols for which the rmdir had succeeded. The fix is to take a blocking inodelk on the subvols before starting rmdir. Since selfheal requires lock on all subvols, if an rmdir is in progess acquiring locks will fail and vice versa. Change-Id: I841a44758c3b88f5e04d1cb73ad36e0cac9fdabb BUG: 1245065 Signed-off-by: Sakshi <sabansal@redhat.com> Reviewed-on: http://review.gluster.org/11725 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-rename.c')
-rw-r--r--xlators/cluster/dht/src/dht-rename.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c
index bde0ce83439..311dbf2d495 100644
--- a/xlators/cluster/dht/src/dht-rename.c
+++ b/xlators/cluster/dht/src/dht-rename.c
@@ -1303,7 +1303,7 @@ dht_rename_lock (call_frame_t *frame)
local->lock.lk_count = count;
ret = dht_nonblocking_inodelk (frame, lk_array, count,
- dht_rename_lock_cbk);
+ FAIL_ON_ANY_ERROR, dht_rename_lock_cbk);
if (ret < 0) {
local->lock.locks = NULL;
local->lock.lk_count = 0;