diff options
Diffstat (limited to 'geo-replication/syncdaemon/resource.py')
| -rw-r--r-- | geo-replication/syncdaemon/resource.py | 13 | 
1 files changed, 11 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py index 0ca023cd8c5..7af3bda4bef 100644 --- a/geo-replication/syncdaemon/resource.py +++ b/geo-replication/syncdaemon/resource.py @@ -814,8 +814,17 @@ class Server(object):                              elif not matching_disk_gfid(gfid, en):                                  collect_failure(e, EEXIST, True)                          else: -                            (pg, bname) = entry2pb(en) -                            blob = entry_pack_reg_stat(gfid, bname, e['stat']) +                            slink = os.path.join(pfx, gfid) +                            st = lstat(slink) +                            # don't create multiple entries with same gfid +                            if isinstance(st, int): +                                (pg, bname) = entry2pb(en) +                                blob = entry_pack_reg_stat(gfid, bname, +                                                           e['stat']) +                            else: +                                cmd_ret = errno_wrap(os.link, [slink, en], +                                                    [ENOENT, EEXIST], [ESTALE]) +                                collect_failure(e, cmd_ret)                  else:                      st1 = lstat(en)                      if isinstance(st1, int):  | 
