static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap,
void *arg)
{
- wake_up(&ceph_inode(inode)->i_cap_wq);
+ struct ceph_inode_info *ci = ceph_inode(inode);
+
+ wake_up(&ci->i_cap_wq);
+ if (arg) {
+ spin_lock(&inode->i_lock);
+ ci->i_wanted_max_size = 0;
+ ci->i_requested_max_size = 0;
+ spin_unlock(&inode->i_lock);
+ }
return 0;
}
-static void wake_up_session_caps(struct ceph_mds_session *session)
+static void wake_up_session_caps(struct ceph_mds_session *session,
+ int reconnect)
{
dout("wake_up_session_caps %p mds%d\n", session, session->s_mds);
- iterate_session_caps(session, wake_up_session_cb, NULL);
+ iterate_session_caps(session, wake_up_session_cb,
+ (void *)(unsigned long)reconnect);
}
/*
/*
* Note new cap ttl, and any transition from stale -> not stale (fresh?).
+ *
+ * Called under session->s_mutex
*/
static void renewed_caps(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session, int is_renew)
spin_unlock(&session->s_cap_lock);
if (wake)
- wake_up_session_caps(session);
+ wake_up_session_caps(session, 0);
}
/*
pr_info("mds%d reconnect completed\n", s->s_mds);
kick_requests(mdsc, i, 1);
ceph_kick_flushing_caps(mdsc, s);
+ wake_up_session_caps(s, 1);
}
}
}