summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/syncdaemon/resource.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index c7fdbf37308..c26054ad9df 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -698,11 +698,19 @@ class Server(object):
logging.warn("Failed to remove %s => %s/%s. %s" %
(gfid, pg, bname, os.strerror(er)))
elif op in ['CREATE', 'MKNOD']:
- blob = entry_pack_reg(
- gfid, bname, e['mode'], e['uid'], e['gid'])
+ slink = os.path.join(pfx, gfid)
+ st = lstat(slink)
+ # don't create multiple entries with same gfid
+ if isinstance(st, int):
+ blob = entry_pack_reg(
+ gfid, bname, e['mode'], e['uid'], e['gid'])
elif op == 'MKDIR':
- blob = entry_pack_mkdir(
- gfid, bname, e['mode'], e['uid'], e['gid'])
+ slink = os.path.join(pfx, gfid)
+ st = lstat(slink)
+ # don't create multiple entries with same gfid
+ if isinstance(st, int):
+ blob = entry_pack_mkdir(
+ gfid, bname, e['mode'], e['uid'], e['gid'])
elif op == 'LINK':
slink = os.path.join(pfx, gfid)
st = lstat(slink)