Re: [PATCH] failslab - failmalloc for slab allocator

From: Akinobu Mita
Date: Mon Aug 14 2006 - 06:16:19 EST

On Sun, Aug 13, 2006 at 12:17:02PM -0700, Andrew Morton wrote:
> We would benefit from having some faul-injection capabilities in the
> mainline kernel.
> - kmalloc failures
> - alloc_pages() failures
> - disk IO errors (there are rumours of a DM module for this, but I
> haven't seen it).

What shold I do for this?
Should we have faul-injection capability in generic_make_request()
like this patch?

Index: work-failmalloc/block/ll_rw_blk.c
--- work-failmalloc.orig/block/ll_rw_blk.c
+++ work-failmalloc/block/ll_rw_blk.c
@@ -3077,6 +3077,9 @@ end_io:
if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)))
goto end_io;

+ if (should_fail(&fail_make_request, bio->bi_size))
+ goto end_io;
* If this device has partitions, remap block n
* of partition p to block n+start(p) of the disk.

> They would need to be lightweight, clean and enabled/configured at runtime,
> not at boot time.

I'll make it configurable at runtime with using debugfs.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at