Re: [PATCH v3] btrfs: fix a check-integrity warning on write caching disabled disk
From: Wang Yugui <hidden>
Date: 2021-11-04 15:34:57
Hi,
On Wed, Nov 03, 2021 at 08:07:22AM +0800, Wang Yugui wrote:quoted
Hi,quoted
On Thu, Oct 28, 2021 at 06:32:54AM +0800, Wang Yugui wrote:quoted
When a disk has write caching disabled, we skip submission of a bio with flush and sync requests before writing the superblock, since it's not needed. However when the integrity checker is enabled, this results in reports that there are metadata blocks referred by a superblock that were not properly flushed. So don't skip the bio submission only when the integrity checker is enabled for the sake of simplicity, since this is a debug tool and not meant for use in non-debug builds. xfstest/btrfs/220 trigger a check-integrity warning like the following when CONFIG_BTRFS_FS_CHECK_INTEGRITY=y and the disk with WCE=0.Does this need the integrity checker to be also enabled by mount options? I don't think compile time (ie the #ifdef) is enough, the message is printed only when it's enabled based on check in __btrfsic_submit_bio "if (!btrfsic_is_initialized) return", where the rest of the function does all the verification.Yes. We need mount option 'check_int' or 'check_int_data' to trigger this check-integrity warning.So the mount options need to be checked here as well.
We just need to add the mount option(check_int/check_int_data) to changelog when CONFIG_BTRFS_FS_CHECK_INTEGRITY=y and the disk with WCE=0. => when CONFIG_BTRFS_FS_CHECK_INTEGRITY=y , and mount option(check_int/check_int_data), and the disk with WCE=0. The check of mount option(check_int/check_int_data) is done later inside btrfsic_submit_bio. No necessary to check mount option(check_int/check_int_data) here, we just need to match submit_bio(linux/bio.h). #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY void btrfsic_submit_bio(struct bio *bio); int btrfsic_submit_bio_wait(struct bio *bio); #else #define btrfsic_submit_bio submit_bio #define btrfsic_submit_bio_wait submit_bio_wait #endif Best Regards Wang Yugui (wangyugui@e16-tech.com) 2021/11/04