Commit 030a7b24 authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Ported commit 1f0a8a384790513c6686e96189ba243b18b675db from castor/master

CASTOR-5419: Ceph aborts when writing a 0-sized buffer

Prevented writes of zero size in DiskWriteTask. They happen
when we read from tape a file aligned with the memory block size.
parent 2d457ab4
......@@ -97,7 +97,8 @@ bool DiskWriteTask::execute(RecallReportPacker& reporter,cta::log::LogContext&
// Write the data.
currentErrorToCount = "Error_diskWrite";
m_stats.dataVolume+=mb->m_payload.size();
mb->m_payload.write(*writeFile);
if (mb->m_payload.size())
mb->m_payload.write(*writeFile);
m_stats.readWriteTime+=localTime.secs(cta::utils::Timer::resetCounter);
checksum = mb->m_payload.adler32(checksum);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment