]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not use StoreEntry::swap_file_sz to write DbCellHeader::entrySize,
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 15 Aug 2013 22:21:16 +0000 (16:21 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 15 Aug 2013 22:21:16 +0000 (16:21 -0600)
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.

src/fs/rock/RockIoState.cc

index 7eabd7d03df3522e1a1a233ca2ab3218542f3a3a..4ee24ac55c31e3b5749eb377d1f8a4a9d7bb4780 100644 (file)
@@ -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