[ 132/171] ceph: close old con before reopening on mds reconnect

From: Greg Kroah-Hartman
Date: Tue Jan 15 2013 - 18:26:31 EST


3.4-stable review patch. If anyone has any objections, please let me know.

------------------


From: Sage Weil <sage@xxxxxxxxxxx>

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 <sage@xxxxxxxxxxx>
Reviewed-by: Alex Elder <elder@xxxxxxxxxxx>
Reviewed-by: Yehuda Sadeh <yehuda@xxxxxxxxxxx>
(cherry picked from commit a53aab645c82f0146e35684b34692c69b5118121)
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
fs/ceph/mds_client.c | 1 +
1 file changed, 1 insertion(+)

--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2528,6 +2528,7 @@ static void send_mds_reconnect(struct ce
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));


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/