From: Alex Rousskov Date: Thu, 15 Aug 2013 22:21:16 +0000 (-0600) Subject: Do not use StoreEntry::swap_file_sz to write DbCellHeader::entrySize, X-Git-Tag: SQUID_3_5_0_1~444^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ffb860202e1230cab555daed5ffcd8f131e8c96;p=thirdparty%2Fsquid.git Do not use StoreEntry::swap_file_sz to write DbCellHeader::entrySize, even during the last write. StoreEntry::swap_file_sz is often set by storeSwapOutFileClosed, which is called after the last write. Also, I am not sure whether partial StoreEntry::swap_file_sz info might later confuse store rebuild code into thinking that the whole entry is malformed. That would be [different] bug. --- diff --git a/src/fs/rock/RockIoState.cc b/src/fs/rock/RockIoState.cc index 7eabd7d03d..4ee24ac55c 100644 --- a/src/fs/rock/RockIoState.cc +++ b/src/fs/rock/RockIoState.cc @@ -254,7 +254,7 @@ Rock::IoState::writeBufToDisk(const SlotId sidNext, bool eof) header.firstSlot = writeAnchor().start; header.nextSlot = sidNext; header.payloadSize = theBuf.size - sizeof(DbCellHeader); - header.entrySize = e->swap_file_sz; // zero except for the very last write + header.entrySize = eof ? offset_ : 0; // storeSwapOutFileClosed sets swap_file_sz after write header.version = writeAnchor().basics.timestamp; // copy finalized db cell header into buffer