From: wangyugui <wangyugui@e16-tech.com>
To: linux-btrfs@vger.kernel.org, l@damenly.su
Cc: wangyugui <wangyugui@e16-tech.com>
Subject: [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC
Date: Fri, 22 Oct 2021 16:26:37 +0800 [thread overview]
Message-ID: <20211022082637.50880-1-wangyugui@e16-tech.com> (raw)
In-Reply-To: <20211022130742.7119.409509F4@e16-tech.com>
xfstest/btrfs/220 tigger a check-integrity warning when
1) CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
2) xfstest/btrfs/220 run on a disk with WCE=1
In write_dev_flush(), submit_bio(REQ_SYNC | REQ_PREFLUSH) can be skipped when
!QUEUE_FLAG_WC. but btrfsic_submit_bio() != submit_bio() when CONFIG_BTRFS_FS_CHECK_INTEGRITY
Signed-off-by: wangyugui <wangyugui@e16-tech.com>
---
fs/btrfs/disk-io.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 355ea88..7b17357 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3971,8 +3971,14 @@ static void write_dev_flush(struct btrfs_device *device)
struct request_queue *q = bdev_get_queue(device->bdev);
struct bio *bio = device->flush_bio;
+ #ifndef CONFIG_BTRFS_FS_CHECK_INTEGRITY
+ /*
+ * submit_bio(REQ_SYNC | REQ_PREFLUSH) can be skipped when !QUEUE_FLAG_WC.
+ * but btrfsic_submit_bio() != submit_bio() when CONFIG_BTRFS_FS_CHECK_INTEGRITY
+ */
if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
return;
+ #endif
bio_reset(bio);
bio->bi_end_io = btrfs_end_empty_barrier;
--
2.32.0
next prev parent reply other threads:[~2021-10-22 8:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-14 7:29 fstest/btrfs/220 tigger a check-integrity warning Wang Yugui
2021-10-15 5:38 ` Wang Yugui
2021-10-21 6:13 ` Su Yue
2021-10-22 4:49 ` Wang Yugui
2021-10-22 5:07 ` Wang Yugui
2021-10-22 8:26 ` wangyugui [this message]
2021-10-22 14:42 ` [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC Filipe Manana
2021-11-02 5:32 ` kernel test robot
2021-11-02 5:49 ` Wang Yugui
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=20211022082637.50880-1-wangyugui@e16-tech.com \
--to=wangyugui@e16-tech.com \
--cc=l@damenly.su \
--cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).