Allow error injection for should_fail_bio is a bit misguided.  It allows
inserting an errno, which is then ignored, but it forced and out of line
call for something that should not exist when error injection is disabled.

Remove the error injection flag in preparation for adding better block
layer error injection, and switch the bpf test to use a MM error
injection site instead.

Signed-off-by: Christoph Hellwig <[email protected]>
---
 block/blk-core.c                                           | 1 -
 tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index b0f0a304ea0b..3a23af3e26a9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -545,7 +545,6 @@ int should_fail_bio(struct bio *bio)
                return -EIO;
        return 0;
 }
-ALLOW_ERROR_INJECTION(should_fail_bio, ERRNO);
 
 /*
  * Check whether this bio extends beyond the end of the device or partition.
diff --git a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c 
b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
index 2e0ddef77ba5..6c8b161cdd7b 100644
--- a/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
+++ b/tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
@@ -588,12 +588,13 @@ static void test_attach_override(void)
                goto cleanup;
        }
 
-       /* The should_fail_bio function is on error injection list,
+       /* The __filemap_add_folio function is on error injection list,
         * attach should succeed.
         */
        link = bpf_program__attach_kprobe_multi_opts(skel->progs.test_override,
-                                                    "should_fail_bio", NULL);
-       if (!ASSERT_OK_PTR(link, "override_attached_should_fail_bio"))
+                                                    "__filemap_add_folio,",
+                                                    NULL);
+       if (!ASSERT_OK_PTR(link, "override_attached___filemap_add_folio,"))
                goto cleanup;
 
        bpf_link__destroy(link);
-- 
2.53.0


Reply via email to