Skip to content

Commit

Permalink
[Pfc] Undo pgRead last-block res workaround; do create local file eve…
Browse files Browse the repository at this point in the history
…n if stat size is 0.
  • Loading branch information
osschar committed Apr 16, 2021
1 parent bdd2cc1 commit 8156a8d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/XrdPfc/XrdPfc.cc
Expand Up @@ -459,7 +459,7 @@ File* Cache::GetFile(const std::string& path, IO* io, long long off, long long f

File *file = 0;

if (filesize > 0)
if (filesize >= 0)
{
file = File::FileOpen(path, off, filesize);
}
Expand Down
9 changes: 0 additions & 9 deletions src/XrdPfc/XrdPfcFile.cc
Expand Up @@ -1177,19 +1177,10 @@ void File::ProcessBlockResponse(BlockResponseHandler* brh, int res)

if (res >= 0 && res != b->get_size())
{
// XXXX pgRead sets res to 4k-rounded result for the last block XXXX
if (b->m_offset + b->get_size() == m_file_size && res == b->get_req_size())
{
TRACEF(Info, tpfx << "Assuming pgRead last-block roundof bug");
res = b->get_size();
}
else
{
// Incorrect number of bytes received, apparently size of the file on the remote
// is different than what the cache expects it to be.
TRACEF(Error, tpfx << "Wrong number of bytes received, assuming remote/local file size mismatch, unlinking local files and initiating shutdown of File object");
Cache::GetInstance().UnlinkFile(m_filename, false);
}
}

XrdSysCondVarHelper _lck(m_state_cond);
Expand Down

0 comments on commit 8156a8d

Please sign in to comment.