path: root/xlators/cluster/dht/src/dht-common.h
diff options
authorJeff Darcy <>2014-07-08 21:56:04 -0400
committerVijay Bellur <>2014-07-17 10:30:56 -0700
commit950f9d8abe714708ca62b86f304e7417127e1132 (patch)
tree29cf61da19955ff9d694025360c332bcbb6ca7f3 /xlators/cluster/dht/src/dht-common.h
parent8896ffd86b1856de17d65874f89a76ad84b6258b (diff)
dht: fix rename race
If two clients try to rename the same file at the same time, we sometimes end up with *no file at all* in either the old or new location. That's kind of bad. The culprit seems to be some overly aggressive cleanup code. AFAICT, based on today's study of the code, the intent of the changed section is to remove any linkfile we might have created before the actual rename. However, what we're removing might not be our extra link. If we're racing with another client that's also doing a rename, it might be the only remaining link to the user's data. The solution, which is good enough to pass this test but almost certainly still not complete, is to be more selective about when we do this unlink. Now, we only do it if we know that, at some point, we did in fact create the link without error (notably ENOENT on the source or EEXIST on the destination) ourselves. Change-Id: I8d8cce150b6f8b372c9fb813c90be58d69f8eb7b BUG: 1117851 Signed-off-by: Jeff Darcy <> Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Vijay Bellur <>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 54f885d..b4c804d 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -199,6 +199,7 @@ struct dht_local {
xlator_t *first_up_subvol;
gf_boolean_t quota_deem_statfs;
+ gf_boolean_t added_link;
typedef struct dht_local dht_local_t;