From 3c7caf1d6e48deada31859cfb0ef26f21c7a8f51 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 27 Apr 2018 15:43:29 +0200 Subject: [PATCH] pkg/host: enable more fault injection --- pkg/host/host_linux.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/host/host_linux.go b/pkg/host/host_linux.go index c76b044f..44a872c2 100644 --- a/pkg/host/host_linux.go +++ b/pkg/host/host_linux.go @@ -215,10 +215,19 @@ func extractStringConst(typ prog.Type) (string, bool) { func EnableFaultInjection() error { if err := osutil.WriteFile("/sys/kernel/debug/failslab/ignore-gfp-wait", []byte("N")); err != nil { - return fmt.Errorf("failed to write /sys/kernel/debug/failslab/ignore-gfp-wait: %v", err) + return fmt.Errorf("failed to write /failslab/ignore-gfp-wait: %v", err) } if err := osutil.WriteFile("/sys/kernel/debug/fail_futex/ignore-private", []byte("N")); err != nil { - return fmt.Errorf("failed to write /sys/kernel/debug/fail_futex/ignore-private: %v", err) + return fmt.Errorf("failed to write /fail_futex/ignore-private: %v", err) + } + if err := osutil.WriteFile("/sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem", []byte("N")); err != nil { + return fmt.Errorf("failed to write /fail_page_alloc/ignore-gfp-highmem: %v", err) + } + if err := osutil.WriteFile("/sys/kernel/debug/fail_page_alloc/ignore-gfp-wait", []byte("N")); err != nil { + return fmt.Errorf("failed to write /fail_page_alloc/ignore-gfp-wait: %v", err) + } + if err := osutil.WriteFile("/sys/kernel/debug/fail_page_alloc/min-order", []byte("0")); err != nil { + return fmt.Errorf("failed to write /fail_page_alloc/min-order: %v", err) } return nil }