aboutsummaryrefslogtreecommitdiffstats
path: root/lib/error-inject.c
diff options
context:
space:
mode:
authorBarnabás Pőcze <[email protected]>2020-12-16 04:47:10 +0000
committerLinus Torvalds <[email protected]>2020-12-16 06:46:19 +0000
commit537cd89484ab57ca38ae25d9557361c0815977d1 (patch)
tree85aa2f2000eb796987d3f432655212189b216ee1 /lib/error-inject.c
parentreboot: hide from sysfs not applicable settings (diff)
downloadkernel-537cd89484ab57ca38ae25d9557361c0815977d1.tar.gz
kernel-537cd89484ab57ca38ae25d9557361c0815977d1.zip
fault-injection: handle EI_ETYPE_TRUE
Commit af3b854492f351d1 ("mm/page_alloc.c: allow error injection") introduced EI_ETYPE_TRUE, but did not extend * lib/error-inject.c:error_type_string(), and * kernel/fail_function.c:adjust_error_retval() to accommodate for this change. Handle EI_ETYPE_TRUE in both functions appropriately by * returning "TRUE" in error_type_string(), * adjusting the return value to true (1) in adjust_error_retval(). Furthermore, simplify the logic of handling EI_ETYPE_NULL in adjust_error_retval(). Link: https://lkml.kernel.org/r/njB1czX0ZgWPR9h61euHIBb5bEyePw9D4D2m3i5lc9Cl96P8Q1308dTcmsEZW7Vtz3Ifz4do-rOtSfuFTyGoEDYokkK2aUqBePVptzZEWfU=@protonmail.com Signed-off-by: Barnabás Pőcze <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Reviewed-by: Akinobu Mita <[email protected]> Cc: "Naveen N. Rao" <[email protected]> Cc: Anil S Keshavamurthy <[email protected]> Cc: "David S. Miller" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/error-inject.c')
-rw-r--r--lib/error-inject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/error-inject.c b/lib/error-inject.c
index aa63751c916f..c73651b15b76 100644
--- a/lib/error-inject.c
+++ b/lib/error-inject.c
@@ -180,6 +180,8 @@ static const char *error_type_string(int etype)
return "ERRNO";
case EI_ETYPE_ERRNO_NULL:
return "ERRNO_NULL";
+ case EI_ETYPE_TRUE:
+ return "TRUE";
default:
return "(unknown)";
}