From: Jens Axboe <axboe@kernel.dk>
To: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: [PATCH] block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST
Date: Tue, 5 Oct 2021 09:32:26 -0600 [thread overview]
Message-ID: <50093280-104b-545a-c4c9-2fc3efd45520@kernel.dk> (raw)
Unnecessary function call, if we don't have that specific configuration
option enabled.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
diff --git a/block/blk-core.c b/block/blk-core.c
index 5454db2fa263..a267f11f55cb 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -697,8 +697,10 @@ static inline bool bio_check_ro(struct bio *bio)
static noinline int should_fail_bio(struct bio *bio)
{
+#ifdef CONFIG_FAIL_MAKE_REQUEST
if (should_fail_request(bdev_whole(bio->bi_bdev), bio->bi_iter.bi_size))
return -EIO;
+#endif
return 0;
}
ALLOW_ERROR_INJECTION(should_fail_bio, ERRNO);
--
Jens Axboe
next reply other threads:[~2021-10-05 15:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 15:32 Jens Axboe [this message]
2021-10-05 17:04 ` [PATCH] block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST Bart Van Assche
2021-10-05 17:10 ` Jens Axboe
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=50093280-104b-545a-c4c9-2fc3efd45520@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/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