]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: fall back to WARN + new allocation if msgpool is depleted
authorSage Weil <sage@newdream.net>
Fri, 18 Sep 2009 21:04:50 +0000 (14:04 -0700)
committerSage Weil <sage@newdream.net>
Fri, 18 Sep 2009 21:04:50 +0000 (14:04 -0700)
src/kernel/msgpool.c

index d4c1ed18d8621136be12f0d9cfc30006f433ea0d..9c91fe0f88d69421c4381e1d96427fb2f4f53d07 100644 (file)
@@ -106,10 +106,6 @@ struct ceph_msg *ceph_msgpool_get(struct ceph_msg_pool *pool)
        wait_queue_t wait;
        struct ceph_msg *msg;
 
-       msg = ceph_msg_new(0, pool->front_len, 0, 0, NULL);
-       if (!IS_ERR(msg))
-               return msg;
-
        while (1) {
                spin_lock(&pool->lock);
                if (likely(pool->num)) {
@@ -126,6 +122,13 @@ struct ceph_msg *ceph_msgpool_get(struct ceph_msg_pool *pool)
                       pool->min, pool->blocking ? "waiting" : "failing");
                spin_unlock(&pool->lock);
 
+               WARN_ON(1);
+
+               /* maybe we can allocate it now? */
+               msg = ceph_msg_new(0, pool->front_len, 0, 0, NULL);
+               if (!IS_ERR(msg))
+                       return msg;
+
                if (!pool->blocking)
                        return ERR_PTR(-ENOMEM);