aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-11-20 16:43:45 -0500
committerSage Weil <sage@newdream.net>2009-11-20 17:24:52 -0500
commit0dc2570fab222affe7739b88b5ed04c511d433dc (patch)
tree217e01db09234b33c20af9c430e2778648315bf6 /fs/ceph/mds_client.c
parentdc14657c9c946f25b84a98e9ffa41b812a70699e (diff)
ceph: reset requested max_size after mds reconnect
The max_size increase request to the MDS can get lost during an MDS restart and reconnect. Reset our requested value after the MDS recovers, so that any blocked writes will re-request a larger max_size upon waking. Also, explicit wake session caps after the reconnect. Normally the cap renewal catches this, but not in the cases where the caps didn't go stale in the first place, which would leave writers waiting on max_size asleep. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 8d95b0f051e4..7da836909abb 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -746,14 +746,24 @@ static void remove_session_caps(struct ceph_mds_session *session)
746static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap, 746static int wake_up_session_cb(struct inode *inode, struct ceph_cap *cap,
747 void *arg) 747 void *arg)
748{ 748{
749 wake_up(&ceph_inode(inode)->i_cap_wq); 749 struct ceph_inode_info *ci = ceph_inode(inode);
750
751 wake_up(&ci->i_cap_wq);
752 if (arg) {
753 spin_lock(&inode->i_lock);
754 ci->i_wanted_max_size = 0;
755 ci->i_requested_max_size = 0;
756 spin_unlock(&inode->i_lock);
757 }
750 return 0; 758 return 0;
751} 759}
752 760
753static void wake_up_session_caps(struct ceph_mds_session *session) 761static void wake_up_session_caps(struct ceph_mds_session *session,
762 int reconnect)
754{ 763{
755 dout("wake_up_session_caps %p mds%d\n", session, session->s_mds); 764 dout("wake_up_session_caps %p mds%d\n", session, session->s_mds);
756 iterate_session_caps(session, wake_up_session_cb, NULL); 765 iterate_session_caps(session, wake_up_session_cb,
766 (void *)(unsigned long)reconnect);
757} 767}
758 768
759/* 769/*
@@ -794,6 +804,8 @@ static int send_renew_caps(struct ceph_mds_client *mdsc,
794 804
795/* 805/*
796 * Note new cap ttl, and any transition from stale -> not stale (fresh?). 806 * Note new cap ttl, and any transition from stale -> not stale (fresh?).
807 *
808 * Called under session->s_mutex
797 */ 809 */
798static void renewed_caps(struct ceph_mds_client *mdsc, 810static void renewed_caps(struct ceph_mds_client *mdsc,
799 struct ceph_mds_session *session, int is_renew) 811 struct ceph_mds_session *session, int is_renew)
@@ -822,7 +834,7 @@ static void renewed_caps(struct ceph_mds_client *mdsc,
822 spin_unlock(&session->s_cap_lock); 834 spin_unlock(&session->s_cap_lock);
823 835
824 if (wake) 836 if (wake)
825 wake_up_session_caps(session); 837 wake_up_session_caps(session, 0);
826} 838}
827 839
828/* 840/*
@@ -2248,6 +2260,7 @@ static void check_new_map(struct ceph_mds_client *mdsc,
2248 pr_info("mds%d reconnect completed\n", s->s_mds); 2260 pr_info("mds%d reconnect completed\n", s->s_mds);
2249 kick_requests(mdsc, i, 1); 2261 kick_requests(mdsc, i, 1);
2250 ceph_kick_flushing_caps(mdsc, s); 2262 ceph_kick_flushing_caps(mdsc, s);
2263 wake_up_session_caps(s, 1);
2251 } 2264 }
2252 } 2265 }
2253} 2266}