From 2948b3b37544faef708e7d1340cc24e491d1912d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 13 Jan 2010 23:37:23 +0000 Subject: [PATCH] fixed file checking bug introduced by fancy disk IO optimizations --- src/disk_io_thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 927ce4218..6d2cffe00 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -1278,7 +1278,6 @@ namespace libtorrent , boost::function const& f) { TORRENT_ASSERT(!m_abort); - TORRENT_ASSERT(!j.callback); TORRENT_ASSERT(j.storage || j.action == disk_io_job::abort_thread || j.action == disk_io_job::update_settings); @@ -1448,6 +1447,7 @@ namespace libtorrent } } + TORRENT_ASSERT(j.offset >= 0); if (m_settings.allow_reordered_disk_operations && defer) { #ifdef TORRENT_DISK_STATS @@ -2023,6 +2023,9 @@ namespace libtorrent // if the check is not done, add it at the end of the job queue if (ret == piece_manager::need_full_check) { + // offset needs to be reset to 0 so that the disk + // job sorting can be done correctly + j.offset = 0; add_job(j, j.callback); continue; }