]> sourceware.org Git - systemtap.git/commitdiff
PR14781 part 1: don't panic
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 29 Oct 2012 00:16:55 +0000 (20:16 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 29 Oct 2012 00:16:55 +0000 (20:16 -0400)
* runtime/stp_utrace.stp (utrace_init): Don't SLAB_PANIC on duplicate
  kmem_cache names, as is sadly likely for concurrent inode-uprobes
  scripts running on CONFIG_DEBUG_VM kernels.
* runtime/linux/task_finder2.c (stap_start_task_finder): Deign to check
  the utrace_init return code, and fail with a touch of grey grace.

runtime/linux/task_finder2.c
runtime/stp_utrace.c

index 27ba2d22afd8356ee802d42abde4480820957339..fff2e623ca31e36278ec7c2cb9bf77ea5009961c 100644 (file)
@@ -1615,7 +1615,14 @@ stap_start_task_finder(void)
                return EBUSY;
        }
 
-       utrace_init();
+       rc = utrace_init();
+        if (rc != 0) { /* PR14781, handle utrace alloc failure. */
+                /* Decrement this back down to UNITIALIZED, to keep
+                   a stap_stop_task_finder() from trying to clean up. */
+               atomic_dec(&__stp_task_finder_state);
+               _stp_error("Failed to initialize utrace hooks");
+                return ENOMEM; /* XXX: or some other one. */
+        }
 
        mmpath_buf = _stp_kmalloc(PATH_MAX);
        if (mmpath_buf == NULL) {
index 6a0735cdde16072494f0a462c00eb8155ed8ed19..11062c9b9b3a6f7c979a408e6a50af52b9a6492c 100644 (file)
@@ -118,10 +118,10 @@ int utrace_init(void)
                INIT_HLIST_HEAD(&task_utrace_table[i]);
        }
 
-       utrace_cachep = KMEM_CACHE(utrace, SLAB_PANIC);
+       utrace_cachep = KMEM_CACHE(utrace, 0);
        if (unlikely(!utrace_cachep))
                goto error;
-       utrace_engine_cachep = KMEM_CACHE(utrace_engine, SLAB_PANIC);
+       utrace_engine_cachep = KMEM_CACHE(utrace_engine, 0);
        if (unlikely(!utrace_engine_cachep))
                goto error;
 
This page took 0.033148 seconds and 5 git commands to generate.