i2c: core: fix NULL pointer dereference under race condition
[pandora-kernel.git] / net / ceph / messenger.c
index 20ba2d5..e85a8d2 100644 (file)
@@ -99,7 +99,12 @@ struct workqueue_struct *ceph_msgr_wq;
 
 int ceph_msgr_init(void)
 {
-       ceph_msgr_wq = alloc_workqueue("ceph-msgr", WQ_NON_REENTRANT, 0);
+       /*
+        * The number of active work items is limited by the number of
+        * connections, so leave @max_active at default.
+        */
+       ceph_msgr_wq = alloc_workqueue("ceph-msgr",
+                                      WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
        if (!ceph_msgr_wq) {
                pr_err("msgr_init failed to create workqueue\n");
                return -ENOMEM;
@@ -2423,7 +2428,7 @@ struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
        m->footer.middle_crc = 0;
        m->footer.data_crc = 0;
        m->footer.flags = 0;
-       m->front_max = front_len;
+       m->front_alloc_len = front_len;
        m->front_is_vmalloc = false;
        m->more_to_follow = false;
        m->ack_stamp = 0;
@@ -2594,8 +2599,8 @@ EXPORT_SYMBOL(ceph_msg_last_put);
 
 void ceph_msg_dump(struct ceph_msg *msg)
 {
-       pr_debug("msg_dump %p (front_max %d nr_pages %d)\n", msg,
-                msg->front_max, msg->nr_pages);
+       pr_debug("msg_dump %p (front_alloc_len %d nr_pages %d)\n", msg,
+                msg->front_alloc_len, msg->nr_pages);
        print_hex_dump(KERN_DEBUG, "header: ",
                       DUMP_PREFIX_OFFSET, 16, 1,
                       &msg->hdr, sizeof(msg->hdr), true);