ceph: allow connection to be reopened by fault callback
authorSage Weil <sage@newdream.net>
Wed, 17 Feb 2010 06:01:03 +0000 (22:01 -0800)
committerSage Weil <sage@newdream.net>
Wed, 17 Feb 2010 06:01:03 +0000 (22:01 -0800)
Fix the messenger to allow a ceph_con_open() during the fault callback.
Previously the work wasn't getting queued on the connection because the
fault path avoids requeued work (normally spurious).  Loop on reopening by
checking for the OPENING state bit.

This fixes OSD reconnects when a TCP connection drops.

Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/messenger.c

index 44bdaf4399245e90c82d603b64287b11dc55082e..acf383f6a9cdaef240154e03367e8ca565a9cb45 100644 (file)
@@ -1808,7 +1808,7 @@ done:
        clear_bit(BUSY, &con->state);
        dout("con->state=%lu\n", con->state);
        if (test_bit(QUEUED, &con->state)) {
-               if (!backoff) {
+               if (!backoff || test_bit(OPENING, &con->state)) {
                        dout("con_work %p QUEUED reset, looping\n", con);
                        goto more;
                }