1
0
Fork 0
alistair23-linux/include
Masami Hiramatsu 663faf9f7b error-injection: Add injectable error types
Add injectable error types for each error-injectable function.

One motivation of error injection test is to find software flaws,
mistakes or mis-handlings of expectable errors. If we find such
flaws by the test, that is a program bug, so we need to fix it.

But if the tester miss input the error (e.g. just return success
code without processing anything), it causes unexpected behavior
even if the caller is correctly programmed to handle any errors.
That is not what we want to test by error injection.

To clarify what type of errors the caller must expect for each
injectable function, this introduces injectable error types:

 - EI_ETYPE_NULL : means the function will return NULL if it
		    fails. No ERR_PTR, just a NULL.
 - EI_ETYPE_ERRNO : means the function will return -ERRNO
		    if it fails.
 - EI_ETYPE_ERRNO_NULL : means the function will return -ERRNO
		       (ERR_PTR) or NULL.

ALLOW_ERROR_INJECTION() macro is expanded to get one of
NULL, ERRNO, ERRNO_NULL to record the error type for
each function. e.g.

 ALLOW_ERROR_INJECTION(open_ctree, ERRNO)

This error types are shown in debugfs as below.

  ====
  / # cat /sys/kernel/debug/error_injection/list
  open_ctree [btrfs]	ERRNO
  io_ctl_init [btrfs]	ERRNO
  ====

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2018-01-12 17:33:38 -08:00
..
acpi Merge branch 'acpi-ec' into acpi 2017-11-30 13:37:29 +01:00
asm-generic error-injection: Add injectable error types 2018-01-12 17:33:38 -08:00
clocksource arm64 updates for 4.15 2017-11-15 10:56:56 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-01-05 12:10:06 -08:00
drm drm: rework delayed connector cleanup in connector_iter 2017-12-13 22:59:00 +01:00
dt-bindings fixes/cleanups for rc1, non-desktop flags for VR 2017-11-23 21:04:56 -10:00
keys
kvm KVM: arm/arm64: timer: Don't set irq as forwarded if no usable GIC 2017-12-18 10:53:23 +01:00
linux error-injection: Add injectable error types 2018-01-12 17:33:38 -08:00
math-emu
media media updates for v4.15-rc1 2017-11-15 20:30:12 -08:00
memory
misc
net net: sch: red: Change the name of the stats struct to be generic 2018-01-10 16:07:40 -05:00
pcmcia
ras
rdma Updates for 4.15 kernel merge window 2017-11-15 14:54:53 -08:00
scsi scsi: libsas: align sata_device's rps_resp on a cacheline 2017-11-21 23:06:32 -05:00
soc We have two changes to the core framework this time around. The first being a 2017-11-17 20:04:24 -08:00
sound ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization 2017-11-22 12:34:56 +01:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2017-11-24 19:19:20 -10:00
trace net: tracepoint: exposing sk_faimily in tracepoint inet_sock_set_state 2018-01-08 14:32:45 -05:00
uapi bpf: simplify xdp_convert_ctx_access for xdp_rxq_info 2018-01-13 00:10:18 +01:00
video fbdev changes for v4.15: 2017-11-20 21:50:24 -10:00
xen xen: fixes for 4.15-rc5 2017-12-22 12:30:10 -08:00