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 <redacted>
---
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