Skip to content
Snippets Groups Projects
Commit adba91fe 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 e2ea6269
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment