From 481b2186cbb802deefd8a57121e6bb3775c362a5 Mon Sep 17 00:00:00 2001 From: Jochen Voss Date: Thu, 9 Oct 2014 19:36:31 +0100 Subject: [PATCH] ldbGenericReplace: correctly handle files with same version but different flags. This fixes syncthing bug #819. --- internal/files/leveldb.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/files/leveldb.go b/internal/files/leveldb.go index 362c04000..5918c14ed 100644 --- a/internal/files/leveldb.go +++ b/internal/files/leveldb.go @@ -232,7 +232,8 @@ func ldbGenericReplace(db *leveldb.DB, folder, device []byte, fs []protocol.File // marked a file as invalid, so handle that too. var ef protocol.FileInfoTruncated ef.UnmarshalXDR(dbi.Value()) - if fs[fsi].Version > ef.Version || fs[fsi].Version != ef.Version { + if fs[fsi].Version > ef.Version || + (fs[fsi].Version == ef.Version && fs[fsi].Flags != ef.Flags) { if lv := ldbInsert(batch, folder, device, newName, fs[fsi]); lv > maxLocalVer { maxLocalVer = lv }