libceph: set CLOSED state bit in con_init
authorAlex Elder <elder@inktank.com>
Tue, 29 May 2012 16:04:58 +0000 (11:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2012 19:38:22 +0000 (11:38 -0800)
commit51588ed26f489e50bfd2359d55abcb4d907149bc
treeb4f266e3164be1b650c89718af7048743f903309
parentd39319ee9b0381848a7e2261d53914e2732191d7
libceph: set CLOSED state bit in con_init

(cherry picked from commit a5988c490ef66cb04ea2f610681949b25c773b3c)

Once a connection is fully initialized, it is really in a CLOSED
state, so make that explicit by setting the bit in its state field.

It is possible for a connection in NEGOTIATING state to get a
failure, leading to ceph_fault() and ultimately ceph_con_close().
Clear that bits if it is set in that case, to reflect that the
connection truly is closed and is no longer participating in a
connect sequence.

Issue a warning if ceph_con_open() is called on a connection that
is not in CLOSED state.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ceph/messenger.c