All of lore.kernel.org
 help / color / mirror / Atom feed
* fstest/btrfs/220 tigger a check-integrity warning
@ 2021-10-14  7:29 Wang Yugui
  2021-10-15  5:38 ` Wang Yugui
  2021-10-21  6:13 ` Su Yue
  0 siblings, 2 replies; 11+ messages in thread
From: Wang Yugui @ 2021-10-14  7:29 UTC (permalink / raw)
  To: linux-btrfs

Hi,

xfstest/btrfs/220 tigger check-integrity warning.

btrfs source:  5.15.0-0.rc5 with btrfs pull for rc6

btrfs kernel config:
CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
# CONFIG_BTRFS_DEBUG is not set
CONFIG_BTRFS_ASSERT=y
CONFIG_BTRFS_FS_REF_VERIFY=y

reproduce frequency: 100%

[ 1917.552758] btrfs: attempt to write superblock which references block M @5242880 (sdb2/5242880/0) which is not flushed out of disk's write cache (block flush_gen=1, dev->flush_gen=0)!
[ 1917.555092] ------------[ cut here ]------------
[ 1917.556238] WARNING: CPU: 28 PID: 843680 at fs/btrfs/check-integrity.c:2196 btrfsic_process_written_superblock+0x22a/0x2a0 [btrfs]
[ 1917.557507] Modules linked in: dm_dust dm_flakey loop rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache netfs xt_conntrack xt_MASQUERADE nf_conntrack_netlink nft_counter xt_addrtype nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink br_netfilter bridge stp llc rfkill overlay ib_core intel_rapl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek snd_hda_codec_generic kvm_intel ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg iTCO_wdt snd_intel_sdw_acpi mei_wdt kvm snd_hda_codec iTCO_vendor_support dcdbas snd_hda_core dell_smm_hwmon snd_hwdep irqbypass snd_seq snd_seq_device rapl snd_pcm intel_cstate intel_uncore pcspkr mei_me i2c_i801 snd_timer i2c_smbus snd mei soundcore lpc_ich nfsd auth_rpcgss nfs_acl lockd grace ip_tables x_tables ext4 mbcache jbd2 btrfs xor zstd_compress raid6_pq zstd_decompress sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_kms_helper syscopyarea sysfillrect
[ 1917.557579]  sysimgblt fb_sys_fops cec bnx2x drm_ttm_helper nvme_tcp ttm nvme_fabrics drm mpt3sas ahci crct10dif_pclmul libahci crc32_pclmul crc32c_intel nvme libata e1000e ghash_clmulni_intel mdio nvme_core raid_class scsi_transport_sas t10_pi wmi dm_multipath sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev fuse
[ 1917.570654] CPU: 28 PID: 843680 Comm: umount Not tainted 5.15.0-0.rc5.39.el8.x86_64 #1
[ 1917.572078] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019
[ 1917.573510] RIP: 0010:btrfsic_process_written_superblock+0x22a/0x2a0 [btrfs]
[ 1917.575014] Code: 44 24 1c 83 f8 03 0f 85 7e fe ff ff 4c 8b 74 24 08 31 d2 48 89 ef 4c 89 f6 e8 82 f1 ff ff 89 c2 31 c0 83 fa ff 75 a1 89 04 24 <0f> 0b 48 89 ef e8 36 3f 01 00 8b 04 24 eb 8f 48 8b 40 60 48 89 04
[ 1917.578044] RSP: 0018:ffffb642afb47940 EFLAGS: 00010246
[ 1917.579569] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000
[ 1917.581101] RDX: 00000000ffffffff RSI: ffff8b722fc97d00 RDI: ffff8b722fc97d00
[ 1917.582645] RBP: ffff8b5601c00000 R08: 0000000000000000 R09: c0000000ffff7fff
[ 1917.584188] R10: 0000000000000001 R11: ffffb642afb476f8 R12: ffffffffffffffff
[ 1917.585737] R13: ffffb642afb47974 R14: ffff8b5499254c00 R15: 0000000000000003
[ 1917.587287] FS:  00007f00a06d4080(0000) GS:ffff8b722fc80000(0000) knlGS:0000000000000000
[ 1917.588846] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1917.590410] CR2: 00007fff5cff5ff0 CR3: 00000001c0c2a006 CR4: 00000000001706e0
[ 1917.591989] Call Trace:
[ 1917.593549]  btrfsic_process_written_block+0x2f7/0x850 [btrfs]
[ 1917.595154]  __btrfsic_submit_bio.part.19+0x310/0x330 [btrfs]
[ 1917.596754]  ? bio_associate_blkg_from_css+0xa4/0x2c0
[ 1917.598309]  btrfsic_submit_bio+0x18/0x30 [btrfs]
[ 1917.599918]  write_dev_supers+0x81/0x2a0 [btrfs]
[ 1917.601525]  ? find_get_pages_range_tag+0x219/0x280
[ 1917.603090]  ? pagevec_lookup_range_tag+0x24/0x30
[ 1917.604642]  ? __filemap_fdatawait_range+0x6d/0xf0
[ 1917.606199]  ? __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
[ 1917.607782]  ? find_first_extent_bit+0x9b/0x160 [btrfs]
[ 1917.609406]  ? __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
[ 1917.610996]  write_all_supers+0x1b3/0xa70 [btrfs]
[ 1917.612625]  ? __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
[ 1917.614213]  btrfs_commit_transaction+0x59d/0xac0 [btrfs]
[ 1917.615851]  close_ctree+0x11d/0x339 [btrfs]
[ 1917.617507]  generic_shutdown_super+0x71/0x110
[ 1917.619102]  kill_anon_super+0x14/0x30
[ 1917.620695]  btrfs_kill_super+0x12/0x20 [btrfs]
[ 1917.622329]  deactivate_locked_super+0x31/0x70
[ 1917.623922]  cleanup_mnt+0xb8/0x140
[ 1917.625515]  task_work_run+0x6d/0xb0
[ 1917.627108]  exit_to_user_mode_prepare+0x1f0/0x200
[ 1917.628702]  syscall_exit_to_user_mode+0x12/0x30
[ 1917.630294]  do_syscall_64+0x46/0x80
[ 1917.631863]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 1917.633424] RIP: 0033:0x7f009f711dfb
[ 1917.634951] Code: 20 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 90 f3 0f 1e fa 31 f6 e9 05 00 00 00 0f 1f 44 00 00 f3 0f 1e fa b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 5d 20 2c 00 f7 d8 64 89 01 48
[ 1917.638123] RSP: 002b:00007fff5cff7928 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
[ 1917.639711] RAX: 0000000000000000 RBX: 000055b68c6c9970 RCX: 00007f009f711dfb
[ 1917.641286] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 000055b68c6c9b50
[ 1917.642863] RBP: 0000000000000000 R08: 000055b68c6ca900 R09: 00007f009f795580
[ 1917.644424] R10: 0000000000000000 R11: 0000000000000246 R12: 000055b68c6c9b50
[ 1917.645960] R13: 00007f00a04bf184 R14: 0000000000000000 R15: 00000000ffffffff
[ 1917.647501] ---[ end trace 2c4b82abcef9eec4 ]---
[ 1917.649018] S-65536(sdb2/65536/1)
[ 1917.649019]  --> 
[ 1917.650492] M-1064960(sdb2/1064960/1)

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2021/10/14



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: fstest/btrfs/220 tigger a check-integrity warning
  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
  1 sibling, 0 replies; 11+ messages in thread
From: Wang Yugui @ 2021-10-15  5:38 UTC (permalink / raw)
  To: linux-btrfs

Hi,

This happend in xfstest tests/btrfs/220
       test_optional_mount_opts "check_int" "check_int"
       test_optional_mount_opts "check_int_data" "check_int_data"

It seem that mount option check_int/check_int_data is broken when 
CONFIG_BTRFS_FS_CHECK_INTEGRITY=y.

tested btrfs version:
	linux 5.15.0-rc5 with 5.15.0-0.rc5 with btrfs pull for rc6
	btrfs-devel misc-next

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2021/10/15

> Hi,
> 
> xfstest/btrfs/220 tigger check-integrity warning.
> 
> btrfs source:  5.15.0-0.rc5 with btrfs pull for rc6
> 
> btrfs kernel config:
> CONFIG_BTRFS_FS=m
> CONFIG_BTRFS_FS_POSIX_ACL=y
> CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
> # CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
> # CONFIG_BTRFS_DEBUG is not set
> CONFIG_BTRFS_ASSERT=y
> CONFIG_BTRFS_FS_REF_VERIFY=y
> 
> reproduce frequency: 100%
> 
> [ 1917.552758] btrfs: attempt to write superblock which references block M @5242880 (sdb2/5242880/0) which is not flushed out of disk's write cache (block flush_gen=1, dev->flush_gen=0)!
> [ 1917.555092] ------------[ cut here ]------------
> [ 1917.556238] WARNING: CPU: 28 PID: 843680 at fs/btrfs/check-integrity.c:2196 btrfsic_process_written_superblock+0x22a/0x2a0 [btrfs]
> [ 1917.557507] Modules linked in: dm_dust dm_flakey loop rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache netfs xt_conntrack xt_MASQUERADE nf_conntrack_netlink nft_counter xt_addrtype nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink br_netfilter bridge stp llc rfkill overlay ib_core intel_rapl_msr intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek snd_hda_codec_generic kvm_intel ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg iTCO_wdt snd_intel_sdw_acpi mei_wdt kvm snd_hda_codec iTCO_vendor_support dcdbas snd_hda_core dell_smm_hwmon snd_hwdep irqbypass snd_seq snd_seq_device rapl snd_pcm intel_cstate intel_uncore pcspkr mei_me i2c_i801 snd_timer i2c_smbus snd mei soundcore lpc_ich nfsd auth_rpcgss nfs_acl lockd grace ip_tables x_tables ext4 mbcache jbd2 btrfs xor zstd_compress raid6_pq zstd_decompress sd_mod sr_mod cdrom sg radeon i2c_algo_bit drm_kms_helper syscopyarea sysfillre
 ct
> [ 1917.557579]  sysimgblt fb_sys_fops cec bnx2x drm_ttm_helper nvme_tcp ttm nvme_fabrics drm mpt3sas ahci crct10dif_pclmul libahci crc32_pclmul crc32c_intel nvme libata e1000e ghash_clmulni_intel mdio nvme_core raid_class scsi_transport_sas t10_pi wmi dm_multipath sunrpc dm_mirror dm_region_hash dm_log dm_mod i2c_dev fuse
> [ 1917.570654] CPU: 28 PID: 843680 Comm: umount Not tainted 5.15.0-0.rc5.39.el8.x86_64 #1
> [ 1917.572078] Hardware name: Dell Inc. Precision T7610/0NK70N, BIOS A18 09/11/2019
> [ 1917.573510] RIP: 0010:btrfsic_process_written_superblock+0x22a/0x2a0 [btrfs]
> [ 1917.575014] Code: 44 24 1c 83 f8 03 0f 85 7e fe ff ff 4c 8b 74 24 08 31 d2 48 89 ef 4c 89 f6 e8 82 f1 ff ff 89 c2 31 c0 83 fa ff 75 a1 89 04 24 <0f> 0b 48 89 ef e8 36 3f 01 00 8b 04 24 eb 8f 48 8b 40 60 48 89 04
> [ 1917.578044] RSP: 0018:ffffb642afb47940 EFLAGS: 00010246
> [ 1917.579569] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000
> [ 1917.581101] RDX: 00000000ffffffff RSI: ffff8b722fc97d00 RDI: ffff8b722fc97d00
> [ 1917.582645] RBP: ffff8b5601c00000 R08: 0000000000000000 R09: c0000000ffff7fff
> [ 1917.584188] R10: 0000000000000001 R11: ffffb642afb476f8 R12: ffffffffffffffff
> [ 1917.585737] R13: ffffb642afb47974 R14: ffff8b5499254c00 R15: 0000000000000003
> [ 1917.587287] FS:  00007f00a06d4080(0000) GS:ffff8b722fc80000(0000) knlGS:0000000000000000
> [ 1917.588846] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 1917.590410] CR2: 00007fff5cff5ff0 CR3: 00000001c0c2a006 CR4: 00000000001706e0
> [ 1917.591989] Call Trace:
> [ 1917.593549]  btrfsic_process_written_block+0x2f7/0x850 [btrfs]
> [ 1917.595154]  __btrfsic_submit_bio.part.19+0x310/0x330 [btrfs]
> [ 1917.596754]  ? bio_associate_blkg_from_css+0xa4/0x2c0
> [ 1917.598309]  btrfsic_submit_bio+0x18/0x30 [btrfs]
> [ 1917.599918]  write_dev_supers+0x81/0x2a0 [btrfs]
> [ 1917.601525]  ? find_get_pages_range_tag+0x219/0x280
> [ 1917.603090]  ? pagevec_lookup_range_tag+0x24/0x30
> [ 1917.604642]  ? __filemap_fdatawait_range+0x6d/0xf0
> [ 1917.606199]  ? __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
> [ 1917.607782]  ? find_first_extent_bit+0x9b/0x160 [btrfs]
> [ 1917.609406]  ? __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
> [ 1917.610996]  write_all_supers+0x1b3/0xa70 [btrfs]
> [ 1917.612625]  ? __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
> [ 1917.614213]  btrfs_commit_transaction+0x59d/0xac0 [btrfs]
> [ 1917.615851]  close_ctree+0x11d/0x339 [btrfs]
> [ 1917.617507]  generic_shutdown_super+0x71/0x110
> [ 1917.619102]  kill_anon_super+0x14/0x30
> [ 1917.620695]  btrfs_kill_super+0x12/0x20 [btrfs]
> [ 1917.622329]  deactivate_locked_super+0x31/0x70
> [ 1917.623922]  cleanup_mnt+0xb8/0x140
> [ 1917.625515]  task_work_run+0x6d/0xb0
> [ 1917.627108]  exit_to_user_mode_prepare+0x1f0/0x200
> [ 1917.628702]  syscall_exit_to_user_mode+0x12/0x30
> [ 1917.630294]  do_syscall_64+0x46/0x80
> [ 1917.631863]  entry_SYSCALL_64_after_hwframe+0x44/0xae
> [ 1917.633424] RIP: 0033:0x7f009f711dfb
> [ 1917.634951] Code: 20 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 90 f3 0f 1e fa 31 f6 e9 05 00 00 00 0f 1f 44 00 00 f3 0f 1e fa b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 5d 20 2c 00 f7 d8 64 89 01 48
> [ 1917.638123] RSP: 002b:00007fff5cff7928 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
> [ 1917.639711] RAX: 0000000000000000 RBX: 000055b68c6c9970 RCX: 00007f009f711dfb
> [ 1917.641286] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 000055b68c6c9b50
> [ 1917.642863] RBP: 0000000000000000 R08: 000055b68c6ca900 R09: 00007f009f795580
> [ 1917.644424] R10: 0000000000000000 R11: 0000000000000246 R12: 000055b68c6c9b50
> [ 1917.645960] R13: 00007f00a04bf184 R14: 0000000000000000 R15: 00000000ffffffff
> [ 1917.647501] ---[ end trace 2c4b82abcef9eec4 ]---
> [ 1917.649018] S-65536(sdb2/65536/1)
> [ 1917.649019]  --> 
> [ 1917.650492] M-1064960(sdb2/1064960/1)
> 
> Best Regards
> Wang Yugui (wangyugui@e16-tech.com)
> 2021/10/14
> 



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: fstest/btrfs/220 tigger a check-integrity warning
  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
  1 sibling, 1 reply; 11+ messages in thread
From: Su Yue @ 2021-10-21  6:13 UTC (permalink / raw)
  To: Wang Yugui; +Cc: linux-btrfs


On Thu 14 Oct 2021 at 15:29, Wang Yugui <wangyugui@e16-tech.com> 
wrote:

> Hi,
>
> xfstest/btrfs/220 tigger check-integrity warning.
>
> btrfs source:  5.15.0-0.rc5 with btrfs pull for rc6
>
> btrfs kernel config:
> CONFIG_BTRFS_FS=m
> CONFIG_BTRFS_FS_POSIX_ACL=y
> CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
> # CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
> # CONFIG_BTRFS_DEBUG is not set
> CONFIG_BTRFS_ASSERT=y
> CONFIG_BTRFS_FS_REF_VERIFY=y
>
> reproduce frequency: 100%
>
> [ 1917.552758] btrfs: attempt to write superblock which 
> references block M
> @5242880 (sdb2/5242880/0) which is not flushed out of disk's 
> write cache (block
> flush_gen=1, dev->flush_gen=0)!
>
Anything special about /dev/sdb? I can reproduce if test device is 
zram
since zram seems to handle FUA in its way.
For normal device backing by file/disk, the test always passed on 
my side.

--
Su
> [ 1917.555092] ------------[ cut here ]------------
> [ 1917.556238] WARNING: CPU: 28 PID: 843680 at 
> fs/btrfs/check-integrity.c:2196 
> btrfsic_process_written_superblock+0x22a/0x2a0 [btrfs]
> [ 1917.557507] Modules linked in: dm_dust dm_flakey loop 
> rpcsec_gss_krb5 nfsv4
> dns_resolver nfs fscache netfs xt_conntrack xt_MASQUERADE 
> nf_conntrack_netlink
> nft_counter xt_addrtype nft_compat nft_chain_nat nf_nat 
> nf_conntrack
> nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink br_netfilter 
> bridge stp llc
> rfkill overlay ib_core intel_rapl_msr intel_rapl_common sb_edac
> x86_pkg_temp_thermal intel_powerclamp coretemp 
> snd_hda_codec_realtek
> snd_hda_codec_generic kvm_intel ledtrig_audio snd_hda_codec_hdmi 
> snd_hda_intel
> snd_intel_dspcfg iTCO_wdt snd_intel_sdw_acpi mei_wdt kvm 
> snd_hda_codec
> iTCO_vendor_support dcdbas snd_hda_core dell_smm_hwmon snd_hwdep 
> irqbypass
> snd_seq snd_seq_device rapl snd_pcm intel_cstate intel_uncore 
> pcspkr mei_me
> i2c_i801 snd_timer i2c_smbus snd mei soundcore lpc_ich nfsd 
> auth_rpcgss nfs_acl
> lockd grace ip_tables x_tables ext4 mbcache jbd2 btrfs xor 
> zstd_compress
> raid6_pq zstd_decompress sd_mod sr_mod cdrom sg radeon 
> i2c_algo_bit
> drm_kms_helper syscopyarea sysfillrect
> [ 1917.557579] sysimgblt fb_sys_fops cec bnx2x drm_ttm_helper 
> nvme_tcp ttm
> nvme_fabrics drm mpt3sas ahci crct10dif_pclmul libahci 
> crc32_pclmul crc32c_intel
> nvme libata e1000e ghash_clmulni_intel mdio nvme_core raid_class
> scsi_transport_sas t10_pi wmi dm_multipath sunrpc dm_mirror 
> dm_region_hash
> dm_log dm_mod i2c_dev fuse
> [ 1917.570654] CPU: 28 PID: 843680 Comm: umount Not tainted 
> 5.15.0-0.rc5.39.el8.x86_64 #1
> [ 1917.572078] Hardware name: Dell Inc. Precision T7610/0NK70N, 
> BIOS A18 09/11/2019
> [ 1917.573510] RIP: 
> 0010:btrfsic_process_written_superblock+0x22a/0x2a0 [btrfs]
> [ 1917.575014] Code: 44 24 1c 83 f8 03 0f 85 7e fe ff ff 4c 8b 
> 74 24 08 31 d2 48
> 89 ef 4c 89 f6 e8 82 f1 ff ff 89 c2 31 c0 83 fa ff 75 a1 89 04 
> 24 <0f> 0b 48 89
> ef e8 36 3f 01 00 8b 04 24 eb 8f 48 8b 40 60 48 89 04
> [ 1917.578044] RSP: 0018:ffffb642afb47940 EFLAGS: 00010246
> [ 1917.579569] RAX: 0000000000000000 RBX: 0000000000000002 RCX: 
> 0000000000000000
> [ 1917.581101] RDX: 00000000ffffffff RSI: ffff8b722fc97d00 RDI: 
> ffff8b722fc97d00
> [ 1917.582645] RBP: ffff8b5601c00000 R08: 0000000000000000 R09: 
> c0000000ffff7fff
> [ 1917.584188] R10: 0000000000000001 R11: ffffb642afb476f8 R12: 
> ffffffffffffffff
> [ 1917.585737] R13: ffffb642afb47974 R14: ffff8b5499254c00 R15: 
> 0000000000000003
> [ 1917.587287] FS:  00007f00a06d4080(0000) 
> GS:ffff8b722fc80000(0000) knlGS:0000000000000000
> [ 1917.588846] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 1917.590410] CR2: 00007fff5cff5ff0 CR3: 00000001c0c2a006 CR4: 
> 00000000001706e0
> [ 1917.591989] Call Trace:
> [ 1917.593549]  btrfsic_process_written_block+0x2f7/0x850 
> [btrfs]
> [ 1917.595154]  __btrfsic_submit_bio.part.19+0x310/0x330 [btrfs]
> [ 1917.596754]  ? bio_associate_blkg_from_css+0xa4/0x2c0
> [ 1917.598309]  btrfsic_submit_bio+0x18/0x30 [btrfs]
> [ 1917.599918]  write_dev_supers+0x81/0x2a0 [btrfs]
> [ 1917.601525]  ? find_get_pages_range_tag+0x219/0x280
> [ 1917.603090]  ? pagevec_lookup_range_tag+0x24/0x30
> [ 1917.604642]  ? __filemap_fdatawait_range+0x6d/0xf0
> [ 1917.606199]  ? 
> __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
> [ 1917.607782]  ? find_first_extent_bit+0x9b/0x160 [btrfs]
> [ 1917.609406]  ? 
> __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
> [ 1917.610996]  write_all_supers+0x1b3/0xa70 [btrfs]
> [ 1917.612625]  ? 
> __raw_callee_save___native_queued_spin_unlock+0x11/0x1e
> [ 1917.614213]  btrfs_commit_transaction+0x59d/0xac0 [btrfs]
> [ 1917.615851]  close_ctree+0x11d/0x339 [btrfs]
> [ 1917.617507]  generic_shutdown_super+0x71/0x110
> [ 1917.619102]  kill_anon_super+0x14/0x30
> [ 1917.620695]  btrfs_kill_super+0x12/0x20 [btrfs]
> [ 1917.622329]  deactivate_locked_super+0x31/0x70
> [ 1917.623922]  cleanup_mnt+0xb8/0x140
> [ 1917.625515]  task_work_run+0x6d/0xb0
> [ 1917.627108]  exit_to_user_mode_prepare+0x1f0/0x200
> [ 1917.628702]  syscall_exit_to_user_mode+0x12/0x30
> [ 1917.630294]  do_syscall_64+0x46/0x80
> [ 1917.631863]  entry_SYSCALL_64_after_hwframe+0x44/0xae
> [ 1917.633424] RIP: 0033:0x7f009f711dfb
> [ 1917.634951] Code: 20 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 
> 90 f3 0f 1e fa 31
> f6 e9 05 00 00 00 0f 1f 44 00 00 f3 0f 1e fa b8 a6 00 00 00 0f 
> 05 <48> 3d 01 f0
> ff ff 73 01 c3 48 8b 0d 5d 20 2c 00 f7 d8 64 89 01 48
> [ 1917.638123] RSP: 002b:00007fff5cff7928 EFLAGS: 00000246 
> ORIG_RAX: 00000000000000a6
> [ 1917.639711] RAX: 0000000000000000 RBX: 000055b68c6c9970 RCX: 
> 00007f009f711dfb
> [ 1917.641286] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 
> 000055b68c6c9b50
> [ 1917.642863] RBP: 0000000000000000 R08: 000055b68c6ca900 R09: 
> 00007f009f795580
> [ 1917.644424] R10: 0000000000000000 R11: 0000000000000246 R12: 
> 000055b68c6c9b50
> [ 1917.645960] R13: 00007f00a04bf184 R14: 0000000000000000 R15: 
> 00000000ffffffff
> [ 1917.647501] ---[ end trace 2c4b82abcef9eec4 ]---
> [ 1917.649018] S-65536(sdb2/65536/1)
> [ 1917.649019]  -->
> [ 1917.650492] M-1064960(sdb2/1064960/1)
>
> Best Regards
> Wang Yugui (wangyugui@e16-tech.com)
> 2021/10/14

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: fstest/btrfs/220 tigger a check-integrity warning
  2021-10-21  6:13 ` Su Yue
@ 2021-10-22  4:49   ` Wang Yugui
  2021-10-22  5:07     ` Wang Yugui
  0 siblings, 1 reply; 11+ messages in thread
From: Wang Yugui @ 2021-10-22  4:49 UTC (permalink / raw)
  To: Su Yue; +Cc: linux-btrfs

Hi,

> > xfstest/btrfs/220 tigger check-integrity warning.
> >
> > btrfs source:  5.15.0-0.rc5 with btrfs pull for rc6
> >
> > btrfs kernel config:
> > CONFIG_BTRFS_FS=m
> > CONFIG_BTRFS_FS_POSIX_ACL=y
> > CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
> > # CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
> > # CONFIG_BTRFS_DEBUG is not set
> > CONFIG_BTRFS_ASSERT=y
> > CONFIG_BTRFS_FS_REF_VERIFY=y
> >
> > reproduce frequency: 100%
> >
> > [ 1917.552758] btrfs: attempt to write superblock which
> > references block M
> > @5242880 (sdb2/5242880/0) which is not flushed out of disk's
> > write cache (block
> > flush_gen=1, dev->flush_gen=0)!
> >
> Anything special about /dev/sdb? I can reproduce if test device is zram
> since zram seems to handle FUA in its way.
> For normal device backing by file/disk, the test always passed on my side.

Thanks for this info.  

I checked it on some disks.
passed:
	SSD/SAS	PX05SMQ040
failed:
	SSD/SAS		HUSMH842
	SSD/NVMe	SM963/SM1715

I noticed that PX05SMQ040 is 'WCE:1/write back', but HUSMH842 is'WCE:0/write
through', both SM963 and SM1715 are 
' [0:0] : 0     Volatile Write Cache Not Present/write through'

I failed to test it on zram.
#mkfs.btrfs /dev/zram0
btrfs-progs v5.10.1
See http://btrfs.wiki.kernel.org for more information.

Detected a SSD, turning off metadata duplication.  Mkfs with -m dup if you want to force metadata duplication.
ERROR: '/dev/zram0' is too small to make a usable filesystem
ERROR: minimum size for each btrfs device is 47185920

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2021/10/22



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: fstest/btrfs/220 tigger a check-integrity warning
  2021-10-22  4:49   ` Wang Yugui
@ 2021-10-22  5:07     ` Wang Yugui
  2021-10-22  8:26       ` [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC wangyugui
  0 siblings, 1 reply; 11+ messages in thread
From: Wang Yugui @ 2021-10-22  5:07 UTC (permalink / raw)
  To: Su Yue, linux-btrfs

Hi,

> > > xfstest/btrfs/220 tigger check-integrity warning.
> > >
> > > btrfs source:  5.15.0-0.rc5 with btrfs pull for rc6
> > >
> > > btrfs kernel config:
> > > CONFIG_BTRFS_FS=m
> > > CONFIG_BTRFS_FS_POSIX_ACL=y
> > > CONFIG_BTRFS_FS_CHECK_INTEGRITY=y
> > > # CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set
> > > # CONFIG_BTRFS_DEBUG is not set
> > > CONFIG_BTRFS_ASSERT=y
> > > CONFIG_BTRFS_FS_REF_VERIFY=y
> > >
> > > reproduce frequency: 100%
> > >
> > > [ 1917.552758] btrfs: attempt to write superblock which
> > > references block M
> > > @5242880 (sdb2/5242880/0) which is not flushed out of disk's
> > > write cache (block
> > > flush_gen=1, dev->flush_gen=0)!
> > >
> > Anything special about /dev/sdb? I can reproduce if test device is zram
> > since zram seems to handle FUA in its way.
> > For normal device backing by file/disk, the test always passed on my side.
> 
> Thanks for this info.  
> 
> I checked it on some disks.
> passed:
> 	SSD/SAS	PX05SMQ040
> failed:
> 	SSD/SAS		HUSMH842
> 	SSD/NVMe	SM963/SM1715
> I noticed that PX05SMQ040 is 'WCE:1/write back', but HUSMH842 is'WCE:0/write
> through', both SM963 and SM1715 are 
> ' [0:0] : 0     Volatile Write Cache Not Present/write through'

When I changed the SSD/SAS from write through to write back,
The result of fstest/btrfs/220 on HUSMH842 is changed from failed to
passed.
# sdparm --set=WCE --save /dev/sda

so there is some process in btrfs wrongly depends on block disk write
back?

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2021/10/22


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC
  2021-10-22  5:07     ` Wang Yugui
@ 2021-10-22  8:26       ` wangyugui
  2021-10-22 14:42         ` Filipe Manana
  2021-11-02  5:32           ` kernel test robot
  0 siblings, 2 replies; 11+ messages in thread
From: wangyugui @ 2021-10-22  8:26 UTC (permalink / raw)
  To: linux-btrfs, l; +Cc: wangyugui

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC
  2021-10-22  8:26       ` [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC wangyugui
@ 2021-10-22 14:42         ` Filipe Manana
  2021-11-02  5:32           ` kernel test robot
  1 sibling, 0 replies; 11+ messages in thread
From: Filipe Manana @ 2021-10-22 14:42 UTC (permalink / raw)
  To: wangyugui; +Cc: linux-btrfs, l

On Fri, Oct 22, 2021 at 9:29 AM wangyugui <wangyugui@e16-tech.com> wrote:
>
> 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

The change log is a bit confusing, something more detailed like this
would be better:

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.

Btw, the line length of a changelog should not exceed 75 characters.

For reference, you could also paste the warning you got in the change
log, it makes it easier
to grep for fixes for example.

>
> 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
> +       */

The comment could use the same type of improvement as well.

>         if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
>                 return;
> +       #endif

As for the code itself, it looks good.

Thanks.

>
>         bio_reset(bio);
>         bio->bi_end_io = btrfs_end_empty_barrier;
> --
> 2.32.0
>


-- 
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC
  2021-10-22  8:26       ` [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC wangyugui
@ 2021-11-02  5:32           ` kernel test robot
  2021-11-02  5:32           ` kernel test robot
  1 sibling, 0 replies; 11+ messages in thread
From: kernel test robot @ 2021-11-02  5:32 UTC (permalink / raw)
  To: wangyugui, linux-btrfs, l; +Cc: kbuild-all, wangyugui

[-- Attachment #1: Type: text/plain, Size: 4079 bytes --]

Hi wangyugui,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kdave/for-next]
[also build test ERROR on v5.15 next-20211101]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/ced40ee717d7e4e8a131b61855a86f0d55aaf817
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
        git checkout ced40ee717d7e4e8a131b61855a86f0d55aaf817
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/btrfs/disk-io.c: In function 'write_dev_flush':
>> fs/btrfs/disk-io.c:3981:24: error: unused variable 'q' [-Werror=unused-variable]
    3981 |  struct request_queue *q = bdev_get_queue(device->bdev);
         |                        ^
   cc1: all warnings being treated as errors


vim +/q +3981 fs/btrfs/disk-io.c

387125fc722a8e Chris Mason       2011-11-18  3974  
387125fc722a8e Chris Mason       2011-11-18  3975  /*
4fc6441aac7589 Anand Jain        2017-06-13  3976   * Submit a flush request to the device if it supports it. Error handling is
4fc6441aac7589 Anand Jain        2017-06-13  3977   * done in the waiting counterpart.
387125fc722a8e Chris Mason       2011-11-18  3978   */
4fc6441aac7589 Anand Jain        2017-06-13  3979  static void write_dev_flush(struct btrfs_device *device)
387125fc722a8e Chris Mason       2011-11-18  3980  {
c2a9c7ab475bc3 Anand Jain        2017-04-06 @3981  	struct request_queue *q = bdev_get_queue(device->bdev);
e0ae999414238a David Sterba      2017-06-06  3982  	struct bio *bio = device->flush_bio;
387125fc722a8e Chris Mason       2011-11-18  3983  
ced40ee717d7e4 wangyugui         2021-10-22  3984  	#ifndef CONFIG_BTRFS_FS_CHECK_INTEGRITY
ced40ee717d7e4 wangyugui         2021-10-22  3985  	/*
ced40ee717d7e4 wangyugui         2021-10-22  3986  	* submit_bio(REQ_SYNC | REQ_PREFLUSH) can be skipped when !QUEUE_FLAG_WC.
ced40ee717d7e4 wangyugui         2021-10-22  3987  	* but btrfsic_submit_bio() != submit_bio() when CONFIG_BTRFS_FS_CHECK_INTEGRITY
ced40ee717d7e4 wangyugui         2021-10-22  3988  	*/
c2a9c7ab475bc3 Anand Jain        2017-04-06  3989  	if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
4fc6441aac7589 Anand Jain        2017-06-13  3990  		return;
ced40ee717d7e4 wangyugui         2021-10-22  3991  	#endif
387125fc722a8e Chris Mason       2011-11-18  3992  
e0ae999414238a David Sterba      2017-06-06  3993  	bio_reset(bio);
387125fc722a8e Chris Mason       2011-11-18  3994  	bio->bi_end_io = btrfs_end_empty_barrier;
74d46992e0d9de Christoph Hellwig 2017-08-23  3995  	bio_set_dev(bio, device->bdev);
8d91012528b3c9 Jan Kara          2017-05-02  3996  	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
387125fc722a8e Chris Mason       2011-11-18  3997  	init_completion(&device->flush_wait);
387125fc722a8e Chris Mason       2011-11-18  3998  	bio->bi_private = &device->flush_wait;
387125fc722a8e Chris Mason       2011-11-18  3999  
43a0111103af2d Lu Fengqi         2017-08-18  4000  	btrfsic_submit_bio(bio);
1c3063b6dbfa03 Anand Jain        2017-12-04  4001  	set_bit(BTRFS_DEV_STATE_FLUSH_SENT, &device->dev_state);
387125fc722a8e Chris Mason       2011-11-18  4002  }
387125fc722a8e Chris Mason       2011-11-18  4003  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 66036 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC
@ 2021-11-02  5:32           ` kernel test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2021-11-02  5:32 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4151 bytes --]

Hi wangyugui,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on kdave/for-next]
[also build test ERROR on v5.15 next-20211101]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/ced40ee717d7e4e8a131b61855a86f0d55aaf817
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
        git checkout ced40ee717d7e4e8a131b61855a86f0d55aaf817
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   fs/btrfs/disk-io.c: In function 'write_dev_flush':
>> fs/btrfs/disk-io.c:3981:24: error: unused variable 'q' [-Werror=unused-variable]
    3981 |  struct request_queue *q = bdev_get_queue(device->bdev);
         |                        ^
   cc1: all warnings being treated as errors


vim +/q +3981 fs/btrfs/disk-io.c

387125fc722a8e Chris Mason       2011-11-18  3974  
387125fc722a8e Chris Mason       2011-11-18  3975  /*
4fc6441aac7589 Anand Jain        2017-06-13  3976   * Submit a flush request to the device if it supports it. Error handling is
4fc6441aac7589 Anand Jain        2017-06-13  3977   * done in the waiting counterpart.
387125fc722a8e Chris Mason       2011-11-18  3978   */
4fc6441aac7589 Anand Jain        2017-06-13  3979  static void write_dev_flush(struct btrfs_device *device)
387125fc722a8e Chris Mason       2011-11-18  3980  {
c2a9c7ab475bc3 Anand Jain        2017-04-06 @3981  	struct request_queue *q = bdev_get_queue(device->bdev);
e0ae999414238a David Sterba      2017-06-06  3982  	struct bio *bio = device->flush_bio;
387125fc722a8e Chris Mason       2011-11-18  3983  
ced40ee717d7e4 wangyugui         2021-10-22  3984  	#ifndef CONFIG_BTRFS_FS_CHECK_INTEGRITY
ced40ee717d7e4 wangyugui         2021-10-22  3985  	/*
ced40ee717d7e4 wangyugui         2021-10-22  3986  	* submit_bio(REQ_SYNC | REQ_PREFLUSH) can be skipped when !QUEUE_FLAG_WC.
ced40ee717d7e4 wangyugui         2021-10-22  3987  	* but btrfsic_submit_bio() != submit_bio() when CONFIG_BTRFS_FS_CHECK_INTEGRITY
ced40ee717d7e4 wangyugui         2021-10-22  3988  	*/
c2a9c7ab475bc3 Anand Jain        2017-04-06  3989  	if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
4fc6441aac7589 Anand Jain        2017-06-13  3990  		return;
ced40ee717d7e4 wangyugui         2021-10-22  3991  	#endif
387125fc722a8e Chris Mason       2011-11-18  3992  
e0ae999414238a David Sterba      2017-06-06  3993  	bio_reset(bio);
387125fc722a8e Chris Mason       2011-11-18  3994  	bio->bi_end_io = btrfs_end_empty_barrier;
74d46992e0d9de Christoph Hellwig 2017-08-23  3995  	bio_set_dev(bio, device->bdev);
8d91012528b3c9 Jan Kara          2017-05-02  3996  	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
387125fc722a8e Chris Mason       2011-11-18  3997  	init_completion(&device->flush_wait);
387125fc722a8e Chris Mason       2011-11-18  3998  	bio->bi_private = &device->flush_wait;
387125fc722a8e Chris Mason       2011-11-18  3999  
43a0111103af2d Lu Fengqi         2017-08-18  4000  	btrfsic_submit_bio(bio);
1c3063b6dbfa03 Anand Jain        2017-12-04  4001  	set_bit(BTRFS_DEV_STATE_FLUSH_SENT, &device->dev_state);
387125fc722a8e Chris Mason       2011-11-18  4002  }
387125fc722a8e Chris Mason       2011-11-18  4003  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 66036 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC
  2021-11-02  5:32           ` kernel test robot
@ 2021-11-02  5:49             ` Wang Yugui
  -1 siblings, 0 replies; 11+ messages in thread
From: Wang Yugui @ 2021-11-02  5:49 UTC (permalink / raw)
  To: kernel test robot; +Cc: linux-btrfs, l, kbuild-all

Hi,

This unused variable warning is already fixed in v2.

and some changelog is updated in this v3 too
https://patchwork.kernel.org/project/linux-btrfs/patch/20211027223254.8095-1-wangyugui@e16-tech.com/

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2021/11/02

> Hi wangyugui,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on kdave/for-next]
> [also build test ERROR on v5.15 next-20211101]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
> config: i386-allyesconfig (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
>         # https://github.com/0day-ci/linux/commit/ced40ee717d7e4e8a131b61855a86f0d55aaf817
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
>         git checkout ced40ee717d7e4e8a131b61855a86f0d55aaf817
>         # save the attached .config to linux build tree
>         make W=1 ARCH=i386 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    fs/btrfs/disk-io.c: In function 'write_dev_flush':
> >> fs/btrfs/disk-io.c:3981:24: error: unused variable 'q' [-Werror=unused-variable]
>     3981 |  struct request_queue *q = bdev_get_queue(device->bdev);
>          |                        ^
>    cc1: all warnings being treated as errors
> 
> 
> vim +/q +3981 fs/btrfs/disk-io.c
> 
> 387125fc722a8e Chris Mason       2011-11-18  3974  
> 387125fc722a8e Chris Mason       2011-11-18  3975  /*
> 4fc6441aac7589 Anand Jain        2017-06-13  3976   * Submit a flush request to the device if it supports it. Error handling is
> 4fc6441aac7589 Anand Jain        2017-06-13  3977   * done in the waiting counterpart.
> 387125fc722a8e Chris Mason       2011-11-18  3978   */
> 4fc6441aac7589 Anand Jain        2017-06-13  3979  static void write_dev_flush(struct btrfs_device *device)
> 387125fc722a8e Chris Mason       2011-11-18  3980  {
> c2a9c7ab475bc3 Anand Jain        2017-04-06 @3981  	struct request_queue *q = bdev_get_queue(device->bdev);
> e0ae999414238a David Sterba      2017-06-06  3982  	struct bio *bio = device->flush_bio;
> 387125fc722a8e Chris Mason       2011-11-18  3983  
> ced40ee717d7e4 wangyugui         2021-10-22  3984  	#ifndef CONFIG_BTRFS_FS_CHECK_INTEGRITY
> ced40ee717d7e4 wangyugui         2021-10-22  3985  	/*
> ced40ee717d7e4 wangyugui         2021-10-22  3986  	* submit_bio(REQ_SYNC | REQ_PREFLUSH) can be skipped when !QUEUE_FLAG_WC.
> ced40ee717d7e4 wangyugui         2021-10-22  3987  	* but btrfsic_submit_bio() != submit_bio() when CONFIG_BTRFS_FS_CHECK_INTEGRITY
> ced40ee717d7e4 wangyugui         2021-10-22  3988  	*/
> c2a9c7ab475bc3 Anand Jain        2017-04-06  3989  	if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
> 4fc6441aac7589 Anand Jain        2017-06-13  3990  		return;
> ced40ee717d7e4 wangyugui         2021-10-22  3991  	#endif
> 387125fc722a8e Chris Mason       2011-11-18  3992  
> e0ae999414238a David Sterba      2017-06-06  3993  	bio_reset(bio);
> 387125fc722a8e Chris Mason       2011-11-18  3994  	bio->bi_end_io = btrfs_end_empty_barrier;
> 74d46992e0d9de Christoph Hellwig 2017-08-23  3995  	bio_set_dev(bio, device->bdev);
> 8d91012528b3c9 Jan Kara          2017-05-02  3996  	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
> 387125fc722a8e Chris Mason       2011-11-18  3997  	init_completion(&device->flush_wait);
> 387125fc722a8e Chris Mason       2011-11-18  3998  	bio->bi_private = &device->flush_wait;
> 387125fc722a8e Chris Mason       2011-11-18  3999  
> 43a0111103af2d Lu Fengqi         2017-08-18  4000  	btrfsic_submit_bio(bio);
> 1c3063b6dbfa03 Anand Jain        2017-12-04  4001  	set_bit(BTRFS_DEV_STATE_FLUSH_SENT, &device->dev_state);
> 387125fc722a8e Chris Mason       2011-11-18  4002  }
> 387125fc722a8e Chris Mason       2011-11-18  4003  
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC
@ 2021-11-02  5:49             ` Wang Yugui
  0 siblings, 0 replies; 11+ messages in thread
From: Wang Yugui @ 2021-11-02  5:49 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4575 bytes --]

Hi,

This unused variable warning is already fixed in v2.

and some changelog is updated in this v3 too
https://patchwork.kernel.org/project/linux-btrfs/patch/20211027223254.8095-1-wangyugui(a)e16-tech.com/

Best Regards
Wang Yugui (wangyugui(a)e16-tech.com)
2021/11/02

> Hi wangyugui,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on kdave/for-next]
> [also build test ERROR on v5.15 next-20211101]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
> config: i386-allyesconfig (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
>         # https://github.com/0day-ci/linux/commit/ced40ee717d7e4e8a131b61855a86f0d55aaf817
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review wangyugui/btrfs-fix-CHECK_INTEGRITY-warning-when-QUEUE_FLAG_WC/20211022-162718
>         git checkout ced40ee717d7e4e8a131b61855a86f0d55aaf817
>         # save the attached .config to linux build tree
>         make W=1 ARCH=i386 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    fs/btrfs/disk-io.c: In function 'write_dev_flush':
> >> fs/btrfs/disk-io.c:3981:24: error: unused variable 'q' [-Werror=unused-variable]
>     3981 |  struct request_queue *q = bdev_get_queue(device->bdev);
>          |                        ^
>    cc1: all warnings being treated as errors
> 
> 
> vim +/q +3981 fs/btrfs/disk-io.c
> 
> 387125fc722a8e Chris Mason       2011-11-18  3974  
> 387125fc722a8e Chris Mason       2011-11-18  3975  /*
> 4fc6441aac7589 Anand Jain        2017-06-13  3976   * Submit a flush request to the device if it supports it. Error handling is
> 4fc6441aac7589 Anand Jain        2017-06-13  3977   * done in the waiting counterpart.
> 387125fc722a8e Chris Mason       2011-11-18  3978   */
> 4fc6441aac7589 Anand Jain        2017-06-13  3979  static void write_dev_flush(struct btrfs_device *device)
> 387125fc722a8e Chris Mason       2011-11-18  3980  {
> c2a9c7ab475bc3 Anand Jain        2017-04-06 @3981  	struct request_queue *q = bdev_get_queue(device->bdev);
> e0ae999414238a David Sterba      2017-06-06  3982  	struct bio *bio = device->flush_bio;
> 387125fc722a8e Chris Mason       2011-11-18  3983  
> ced40ee717d7e4 wangyugui         2021-10-22  3984  	#ifndef CONFIG_BTRFS_FS_CHECK_INTEGRITY
> ced40ee717d7e4 wangyugui         2021-10-22  3985  	/*
> ced40ee717d7e4 wangyugui         2021-10-22  3986  	* submit_bio(REQ_SYNC | REQ_PREFLUSH) can be skipped when !QUEUE_FLAG_WC.
> ced40ee717d7e4 wangyugui         2021-10-22  3987  	* but btrfsic_submit_bio() != submit_bio() when CONFIG_BTRFS_FS_CHECK_INTEGRITY
> ced40ee717d7e4 wangyugui         2021-10-22  3988  	*/
> c2a9c7ab475bc3 Anand Jain        2017-04-06  3989  	if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
> 4fc6441aac7589 Anand Jain        2017-06-13  3990  		return;
> ced40ee717d7e4 wangyugui         2021-10-22  3991  	#endif
> 387125fc722a8e Chris Mason       2011-11-18  3992  
> e0ae999414238a David Sterba      2017-06-06  3993  	bio_reset(bio);
> 387125fc722a8e Chris Mason       2011-11-18  3994  	bio->bi_end_io = btrfs_end_empty_barrier;
> 74d46992e0d9de Christoph Hellwig 2017-08-23  3995  	bio_set_dev(bio, device->bdev);
> 8d91012528b3c9 Jan Kara          2017-05-02  3996  	bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH;
> 387125fc722a8e Chris Mason       2011-11-18  3997  	init_completion(&device->flush_wait);
> 387125fc722a8e Chris Mason       2011-11-18  3998  	bio->bi_private = &device->flush_wait;
> 387125fc722a8e Chris Mason       2011-11-18  3999  
> 43a0111103af2d Lu Fengqi         2017-08-18  4000  	btrfsic_submit_bio(bio);
> 1c3063b6dbfa03 Anand Jain        2017-12-04  4001  	set_bit(BTRFS_DEV_STATE_FLUSH_SENT, &device->dev_state);
> 387125fc722a8e Chris Mason       2011-11-18  4002  }
> 387125fc722a8e Chris Mason       2011-11-18  4003  
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-11-02  5:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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       ` [PATCH] btrfs: fix CHECK_INTEGRITY warning when !QUEUE_FLAG_WC wangyugui
2021-10-22 14:42         ` Filipe Manana
2021-11-02  5:32         ` kernel test robot
2021-11-02  5:32           ` kernel test robot
2021-11-02  5:49           ` Wang Yugui
2021-11-02  5:49             ` Wang Yugui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.