]> Sergey Matveev's repositories - btrtrc.git/commitdiff
file storage: When file verification fails, we forgot to pass back incomplete
authorMatt Joiner <anacrolix@gmail.com>
Thu, 10 Jul 2025 06:31:28 +0000 (16:31 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 10 Jul 2025 06:31:28 +0000 (16:31 +1000)
storage/file-piece.go

index 31bc94634f5c6648b99560417934bb708b01edc1..07257a394ea23d60d408c2a9478de22e90863f1e 100644 (file)
@@ -103,11 +103,13 @@ func (me *filePieceImpl) Completion() Completion {
        }
 
        if !verified {
-               // The completion was wrong, fix it.
+               // The completion was wrong, fix it. TODO: Fix all other affected pieces too so we don't
+               // spam log messages, or record that the file is known to be bad until it comes good again.
                err := me.MarkNotComplete()
                if err != nil {
                        c.Err = fmt.Errorf("error marking piece not complete: %w", err)
                }
+               c.Complete = false
        }
 
        return c