Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3973 closed Bug (fixed)

Just in time verification verifies fresh downloaded torrents

Reported by: jusid Owned by: jordan
Priority: Normal Milestone:
Component: libtransmission Version: 2.13+
Severity: Major Keywords:
Cc:

Description

There is a problem with new "just in time verification". Let a torrent started downloading at 1:00 and completed at 3:00. After that, the torrent file has modification time 3:00. But data pieces have timeChecked value between 1:00 and 3:00. When the torrent starts seeding, the just in time verification check that pieces check time is less than 3:00 (file modification time) and re-check all torrent pieces again.

Change History (9)

comment:1 Changed 11 years ago by jordan

  • Milestone 2.20 deleted
  • Severity changed from Critical to Major
  • Status changed from new to assigned

comment:2 Changed 11 years ago by jordan

jordan * r11813 libtransmission/ (fdlimit.c torrent.c):

(trunk libT) #3973 "JIT verification verifies freshly-downloaded torrents" -- test fix.

Files downloaded in Transmission 2.20 betas [1..3] forced each piece to be checked twice -- once on download, and once when uploading the piece for the first time. Older versions of Transmission didn't perform the latter check unless the file had changed after it was downloaded. This commit restores that behavior.

comment:3 Changed 11 years ago by jordan

jusid: testing with r11814 or higher would be most appreciated.

comment:4 Changed 11 years ago by jusid

Jordan, I just finished the testing. The problem seems to be fixed. Thank you very much for the quick fix.

comment:5 Changed 11 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:6 Changed 11 years ago by jordan

r11816 libtransmission/ (bencode.c fdlimit.c fdlimit.h):

#3973 "JIT verification verifies fresh downloaded torrents" -- win32 portability fix for r11813.

fsync() doesn't exist on Windows. bencode had a private function, tr_fsync(), that is a portability wrapper around fsync() on *nix and _commit() on win32. Make this function package-visible, rather than private, so fdlimit.c can use it too.

comment:7 Changed 11 years ago by jordan

r11817 libtransmission/ (fdlimit.c fdlimit.h):

#3973 "JIT verification verifies fresh downloaded torrents" -- improvement to r11813.

r11813 fixed the timestamp issue by fsync()ing files before close()ing them in tr_close_file(). This approach causes unnecessary overhead because *all* files closed that way are fsync()ed. If we move the fsync() call further up the call chain to tr_fdFileClose(), we can ensure it's only used on downloaded files that were opened with a writable access mode.

Last edited 11 years ago by jordan (previous) (diff)

comment:8 Changed 11 years ago by jordan

r11818: remove a debugging printf() statement that shouldn't have been checked in.

comment:9 Changed 11 years ago by jordan

Gotta love it when the commits keep rolling in after the ticket's been marked as closed ;)

Note: See TracTickets for help on using tickets.