]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: don't leak ref when queuing fault work
authorSage Weil <sage@newdream.net>
Tue, 1 Sep 2009 18:04:17 +0000 (11:04 -0700)
committerSage Weil <sage@newdream.net>
Tue, 1 Sep 2009 18:04:17 +0000 (11:04 -0700)
src/kernel/messenger.c

index 56c00c3a6dcc1c0cf80f08aa1933412a65c1c522..b55128316a6d73ab2d52d8ac3f30d95f9bb599d5 100644 (file)
@@ -1517,12 +1517,11 @@ static void ceph_fault(struct ceph_connection *con)
                con->delay *= 2;
 
        /* explicitly schedule work to try to reconnect again later. */
-       dout("fault queueing %p %d -> %d delay %lu\n", con,
-            atomic_read(&con->nref), atomic_read(&con->nref) + 1,
-            con->delay);
+       dout("fault queueing %p delay %lu\n", con, con->delay);
        con->ops->get(con);
-       queue_delayed_work(ceph_msgr_wq, &con->work,
-                          round_jiffies_relative(con->delay));
+       if (queue_delayed_work(ceph_msgr_wq, &con->work,
+                              round_jiffies_relative(con->delay)) == 0)
+               con->ops->put(con);
 }