From: Christoph Hellwig <hch@infradead.org>
To: Prasad Singamsetty <prasad.singamsetty@oracle.com>
Cc: linux-block@vger.kernel.org, axboe@kernel.dk, arnd@arndb.de,
ojeda@kernel.org, nathan@kernel.org, martin.petersen@oracle.com
Subject: Re: [PATCH 1/1] block: prevent calls to should_fail_bio() optimized by gcc
Date: Mon, 21 Apr 2025 04:51:36 -0700 [thread overview]
Message-ID: <aAYxSOxeM-mQgNyF@infradead.org> (raw)
In-Reply-To: <20250417163432.1336124-1-prasad.singamsetty@oracle.com>
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.
next prev parent reply other threads:[~2025-04-21 11:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 16:34 [PATCH 1/1] block: prevent calls to should_fail_bio() optimized by gcc Prasad Singamsetty
2025-04-17 17:50 ` Jens Axboe
2025-04-17 18:40 ` Prasad Singamsetty
2025-04-17 17:55 ` Miguel Ojeda
2025-04-17 18:51 ` Prasad Singamsetty
2025-04-21 11:51 ` Christoph Hellwig [this message]
2025-04-22 21:58 ` Prasad Singamsetty
2025-04-23 5:33 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aAYxSOxeM-mQgNyF@infradead.org \
--to=hch@infradead.org \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=nathan@kernel.org \
--cc=ojeda@kernel.org \
--cc=prasad.singamsetty@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox