]> git.baikalelectronics.ru Git - kernel.git/commit
block: Add should_fail_bio() for bpf error injection
authorHoward McLauchlan <hmclauchlan@fb.com>
Tue, 6 Feb 2018 22:05:39 +0000 (14:05 -0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 6 Feb 2018 22:09:51 +0000 (15:09 -0700)
commita3cca9e174dce268e20c477ddc65c650f8f018e4
tree14c7784a2e69497b38cbb35b3554a4482261fab9
parente3d73bed0df5c0885e31d7a1ce7d132371d56ccc
block: Add should_fail_bio() for bpf error injection

The classic error injection mechanism, should_fail_request() does not
support use cases where more information is required (from the entire
struct bio, for example).

To that end, this patch introduces should_fail_bio(), which calls
should_fail_request() under the hood but provides a convenient
place for kprobes to hook into if they require the entire struct bio.
This patch also replaces some existing calls to should_fail_request()
with should_fail_bio() with no degradation in performance.

Signed-off-by: Howard McLauchlan <hmclauchlan@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c