]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
libceph: WARN, don't BUG on unexpected connection states
authorAlex Elder <elder@inktank.com>
Wed, 26 Dec 2012 16:43:57 +0000 (10:43 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:46:48 +0000 (08:46 -0800)
commitc65b5b47c4c8c6e67e245edc2c918d75f5f2e714
treef12784fd958985b70882d456c5d59c40e0c4d28b
parent5172e2dbec4277186424c479f04562db96bee404
libceph: WARN, don't BUG on unexpected connection states

(cherry picked from commit 122070a2ffc91f87fe8e8493eb0ac61986c5557c)

A number of assertions in the ceph messenger are implemented with
BUG_ON(), killing the system if connection's state doesn't match
what's expected.  At this point our state model is (evidently) not
well understood enough for these assertions to trigger a BUG().
Convert all BUG_ON(con->state...) calls to be WARN_ON(con->state...)
so we learn about these issues without killing the machine.

We now recognize that a connection fault can occur due to a socket
closure at any time, regardless of the state of the connection.  So
there is really nothing we can assert about the state of the
connection at that point so eliminate that assertion.

Reported-by: Ugis <ugis22@gmail.com>
Tested-by: Ugis <ugis22@gmail.com>
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