Skip to content

Commit

Permalink
Qfs client library: fix handling invalidated i-node path cache entrie…
Browse files Browse the repository at this point in the history
…s, where the entry path is valid, but i-node number and generation aren't. For example: i-node (file or directory) was deleted with bulk delete was used (rmdirs) and then created again.
  • Loading branch information
mikeov committed Mar 19, 2013
1 parent bbe4497 commit 1f2437a
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/cc/libclient/KfsClient.cc
Expand Up @@ -4264,19 +4264,25 @@ KfsClientImpl::NewFAttr(kfsFileId_t parentFid, const string& name,
pair<NameToFAttrMap::iterator, bool> const
res = mPathCache.insert(make_pair(pathname, fa));
if (! res.second) {
const FAttr* const cfa = res.first->second;
KFS_LOG_STREAM_FATAL << "fattr path entry already exists: " <<
" parent: " << parentFid <<
" name: " << name <<
" path: " << pathname <<
" gen: " << mFAttrCacheGeneration <<
" entry:"
" gen: " << cfa->generation <<
" parent: " << cfa->fidNameIt->first.first <<
" name: " << cfa->fidNameIt->first.second <<
KFS_LOG_EOM;
MsgLogger::Stop();
abort();
FAttr* const cfa = res.first->second;
if (cfa->generation == mFAttrCacheGeneration ||
cfa->nameIt != res.first) {
KFS_LOG_STREAM_FATAL << "fattr path entry already exists: " <<
" parent: " << parentFid <<
" name: " << name <<
" path: " << pathname <<
" gen: " << mFAttrCacheGeneration <<
" entry:"
" gen: " << cfa->generation <<
" parent: " << cfa->fidNameIt->first.first <<
" name: " << cfa->fidNameIt->first.second <<
KFS_LOG_EOM;
MsgLogger::Stop();
abort();
}
cfa->nameIt = mPathCacheNone;
Delete(cfa);
res.first->second = fa;
}
fa->nameIt = res.first;
} else {
Expand Down

0 comments on commit 1f2437a

Please sign in to comment.