From: Liu Song <liusong@linux.alibaba.com>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH] block: remove bio_check_ro
Date: Tue, 30 Aug 2022 15:58:48 +0800 [thread overview]
Message-ID: <1661846328-107799-1-git-send-email-liusong@linux.alibaba.com> (raw)
From: Liu Song <liusong@linux.alibaba.com>
Partially revert make "bio_check_ro" only return false, and may generate
at most one warning print.
From the commit log of a32e236eb9, it has been stated that it is
compatible with the old lvm tool, so there is a high probability that
this alarm will not really be noticed, so it is better to remove it
directly.
Signed-off-by: Liu Song <liusong@linux.alibaba.com>
---
block/blk-core.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index a0d1104..811c2dc 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -487,20 +487,6 @@ static int __init fail_make_request_debugfs(void)
late_initcall(fail_make_request_debugfs);
#endif /* CONFIG_FAIL_MAKE_REQUEST */
-static inline bool bio_check_ro(struct bio *bio)
-{
- if (op_is_write(bio_op(bio)) && bdev_read_only(bio->bi_bdev)) {
- if (op_is_flush(bio->bi_opf) && !bio_sectors(bio))
- return false;
- pr_warn("Trying to write to read-only block-device %pg\n",
- bio->bi_bdev);
- /* Older lvm-tools actually trigger this */
- return false;
- }
-
- return false;
-}
-
static noinline int should_fail_bio(struct bio *bio)
{
if (should_fail_request(bdev_whole(bio->bi_bdev), bio->bi_iter.bi_size))
@@ -722,8 +708,7 @@ void submit_bio_noacct(struct bio *bio)
if (should_fail_bio(bio))
goto end_io;
- if (unlikely(bio_check_ro(bio)))
- goto end_io;
+
if (!bio_flagged(bio, BIO_REMAPPED)) {
if (unlikely(bio_check_eod(bio)))
goto end_io;
--
1.8.3.1
reply other threads:[~2022-08-30 7:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1661846328-107799-1-git-send-email-liusong@linux.alibaba.com \
--to=liusong@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@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