If a request is against a dentry, and we get a traceless reply, clear
the directory I_COMPLETE flag on the parent directory because we can no
longer trust that our cache is complete.
It is possible we could do something a bit more intelligent here, but it
is not trivial because of racing requests, and traceless replies are
rare, so it's not worth the effort.
Signed-off-by: Sage Weil <sage@inktank.com>
bufferlist::iterator p = reply->get_trace_bl().begin();
if (p.end()) {
ldout(cct, 10) << "insert_trace -- no trace" << dendl;
+
+ if (request->dentry &&
+ request->dentry->dir &&
+ (request->dentry->dir->parent_inode->flags & I_COMPLETE)) {
+ ldout(cct, 10) << " clearing I_COMPLETE on " << *request->dentry->dir->parent_inode << dendl;
+ request->dentry->dir->parent_inode->flags &= ~I_COMPLETE;
+ request->dentry->dir->release_count++;
+ }
return NULL;
}