- reference count lease validations on path lookup?
kernel client
+- flush all WRITE caps on session close
- flush caps on sync, fsync, etc.
- hmm, should these go in a per-session "check" list, instead of independently scheduling delayed_work for each inode?
- fsync should flush cap file size to mds. not sure how to block on that, however.. maybe a want_reply flag in the cap msg?
void Client::handle_file_caps(MClientFileCaps *m)
{
int mds = m->get_source().num();
- Inode *in = 0;
- if (inode_map.count(m->get_ino())) in = inode_map[ m->get_ino() ];
m->clear_payload(); // for if/when we send back to MDS
//assert(mds_sessions.count(mds)); // HACK FIXME SOON
mds_sessions[mds]++;
+ Inode *in = 0;
+ if (inode_map.count(m->get_ino())) in = inode_map[ m->get_ino() ];
+ if (!in) {
+ /*
+ * this can happen if we release caps, and then trim the inode from our cache,
+ * but are racing with, e.g., an mds callback.
+ */
+ dout(5) << "handle_file_caps don't have ino " << m->get_ino() << dendl;
+ delete m;
+ return;
+ }
+
// reap?
if (m->get_op() == CEPH_CAP_OP_IMPORT) {
int other = m->get_migrate_mds();
}
}
- assert(in);
-
// stale?
if (m->get_op() == CEPH_CAP_OP_EXPORT) {
dout(5) << "handle_file_caps on ino " << m->get_ino() << " seq " << m->get_seq() << " from mds" << mds << " now exported/stale" << dendl;