On Thu, Apr 17, 2025 at 09:34:32AM -0700, Prasad Singamsetty wrote: > When CONFIG_FAIL_MAKE_REQUEST is not enabled, gcc may optimize out > calls to should_fail_bio() because the content of should_fail_bio() > is empty returning always 'false'. The gcc compiler then detects > the function call to should_fail_bio() being empty and optimizes > out the call to it. Yes, that's intentional and a good thing becaue we don't want to pay the overhead for the fault injetion helper. > This prevents block I/O error injection programs > attached to it from working. The compiler is not aware of the side > effect of calling this probe function. I can't see any attachment. But if this is a bpf program or kernel module using kprobes then there is absolutely zero expectation that a static inline function actually exists in the binary kernel, so you should not rely on that.