Skip to content

Commit

Permalink
Fix index offset i Sync(). This applies only to hdfs healing mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
alja committed Jun 16, 2016
1 parent 9bfd662 commit 56e86a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/XrdFileCache/XrdFileCacheFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,12 @@ bool File::Open()
}
else {
m_fileSize = m_fileSize;
int ss = (m_fileSize - 1)/m_cfi.GetBufferSize() + 1;
TRACEF(Debug, "Creating new file info, data size = " << m_fileSize << " num blocks = " << ss);
m_cfi.SetBufferSize(Cache::GetInstance().RefConfiguration().m_bufferSize);
m_cfi.SetFileSize(m_fileSize);
m_cfi.WriteHeader(m_infoFile);
m_infoFile->Fsync();
int ss = (m_fileSize - 1)/m_cfi.GetBufferSize() + 1;
TRACEF(Debug, "Creating new file info, data size = " << m_fileSize << " num blocks = " << ss);
}

if (m_prefetchState != kComplete) cache()->RegisterPrefetchFile(this);
Expand Down Expand Up @@ -753,7 +753,7 @@ void File::Sync()
XrdSysMutexHelper _lck(&m_syncStatusMutex);
for (std::vector<int>::iterator i = m_writes_during_sync.begin(); i != m_writes_during_sync.end(); ++i)
{
m_cfi.SetBitWriteCalled(offsetIdx(*i));
m_cfi.SetBitWriteCalled(*i);
}
written_while_in_sync = m_non_flushed_cnt = (int) m_writes_during_sync.size();
m_writes_during_sync.clear();
Expand Down

0 comments on commit 56e86a7

Please sign in to comment.