From: Sage Weil Date: Mon, 30 Jul 2012 23:21:17 +0000 (-0700) Subject: ceph: close old con before reopening on mds reconnect X-Git-Tag: firefly_0821_release~3680^2~2292^2~51 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a53aab645c82f0146e35684b34692c69b5118121;p=firefly-linux-kernel-4.4.55.git ceph: close old con before reopening on mds reconnect When we detect a mds session reset, close the old ceph_connection before reopening it. This ensures we clean up the old socket properly and keep the ceph_connection state correct. Signed-off-by: Sage Weil Reviewed-by: Alex Elder Reviewed-by: Yehuda Sadeh --- diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 39b76d66bc5d..a5a735422aa7 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2518,6 +2518,7 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, session->s_state = CEPH_MDS_SESSION_RECONNECTING; session->s_seq = 0; + ceph_con_close(&session->s_con); ceph_con_open(&session->s_con, CEPH_ENTITY_TYPE_MDS, mds, ceph_mdsmap_get_addr(mdsc->mdsmap, mds));