]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: Add session to sessionmap when its state becomes opening 2610/head 2617/head
authorYan, Zheng <zyan@redhat.com>
Tue, 30 Sep 2014 04:31:30 +0000 (12:31 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 30 Sep 2014 12:58:07 +0000 (20:58 +0800)
commita67c2f9768e43f2b166fec74f1249c47564d79f1
treec0a00f2b1672e1e2d615c832534c97d87186ece7
parentccf3e06a7c7d33311764a17230bff3e9effd9679
mds: Add session to sessionmap when its state becomes opening

following sequence events may happen.
- client sends reconnect message to a recovering MDS.
- MDS::ms_verify_authorizer() create a session for the client, the
  session is in closed state.
- MDS::handle_client_reconnect() sends session close message to
  the client.
- client closes the old connection and opens a new connection
- MDS::ms_verify_authorizer() is called for a new connection
- MDS::ms_handle_reset() is called for the old connection
- MDS::ms_handle_accept() is called for the new connection

MDS::ms_handle_reset() removes client's session from the session map, this
can cause null pointer dereference when handling client request. The fix
is add session to sessionmap when its state becomes 'opening' and remove
session from sessionmap when its state becomes 'closed'

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/MDS.cc
src/mds/Server.cc