bcache icon indicating copy to clipboard operation
bcache copied to clipboard

BCache + Linux Kernel 5.12 broken

Open duzun opened this issue 3 years ago • 1 comments

I've been using bcache + btrfs for a while on two different machines with no issue, up to kernel 5.11. After I've upgraded to kernel 5.12, I can't access the bcache device any more.

I guess there is something to do with this.

> uname -a 
Linux Zerver 5.12.0-1-MANJARO #1 SMP PREEMPT Mon Apr 26 22:09:28 UTC 2021 x86_64 GNU/Linux
> lsblk 
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0   3.6T  0 disk 
├─sda1        8:1    0   512M  0 part 
├─sda2        8:2    0    40G  0 part 
└─sda3        8:3    0   3.6T  0 part /backup
sdb           8:16   0 931.5G  0 disk 
└─sdb1        8:17   0 931.5G  0 part 
  └─bcache0 254:0    0 931.5G  0 disk /hdd
sdc           8:32   0 238.5G  0 disk 
├─sdc1        8:33   0   150G  0 part /
├─sdc2        8:34   0    99M  0 part /boot/efi
├─sdc3        8:35   0  75.4G  0 part 
│ └─bcache0 254:0    0 931.5G  0 disk /hdd
└─sdc4        8:36   0  12.8G  0 part [SWAP]
dmesg | grep -i bcache
[   19.927658] bcache: register_bdev() registered backing device sdb1
[   20.187699] bcache: bch_journal_replay() journal replay done, 167 keys in 6 entries, seq 1294607
[   20.235498] bcache: bch_cached_dev_attach() Caching sdb1 as bcache0 on set c37f21c6-5f1d-4bd3-9fb0-5181a4908e08
[   20.235544] bcache: register_cache() registered cache device sdc3
[   20.312354] BTRFS: device label Data devid 1 transid 78169 /dev/bcache0 scanned by systemd-udevd (360)
[   20.329275] BTRFS info (device bcache0): enabling auto defrag
[   20.329279] BTRFS info (device bcache0): disk space caching is enabled
[   20.329280] BTRFS info (device bcache0): has skinny extents
[   22.940838] BTRFS info (device bcache0): enabling ssd optimizations
[15167.365514]  cached_dev_cache_miss+0xf7/0x2f0 [bcache]
[15167.365536]  cache_lookup_fn+0x13a/0x310 [bcache]
[15167.365549]  ? bch_data_invalidate+0x190/0x190 [bcache]
[15167.365562]  bch_btree_map_keys_recurse+0x9f/0x1a0 [bcache]
[15167.365575]  ? bch_data_invalidate+0x190/0x190 [bcache]
[15167.365588]  bch_btree_map_keys_recurse+0x11a/0x1a0 [bcache]
[15167.365600]  bch_btree_map_keys+0x1cb/0x1f0 [bcache]
[15167.365612]  ? bch_data_invalidate+0x190/0x190 [bcache]
[15167.365625]  cache_lookup+0xa1/0x160 [bcache]
[15167.365645]  cached_dev_submit_bio+0x9c1/0xd30 [bcache]
[15167.365944] Modules linked in: udp_diag tcp_diag inet_diag xt_nat xt_tcpudp veth xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter bridge stp llc hid_logitech_hidpp joydev mousedev hid_logitech_dj usbhid snd_hda_codec_hdmi rfkill intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel vfat fat iTCO_wdt intel_pmc_bxt mxm_wmi intel_wmi_thunderbolt overlay iTCO_vendor_support kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd btrfs rapl intel_cstate snd_hda_codec_realtek intel_uncore snd_hda_codec_generic blake2b_generic ledtrig_audio xor bcache raid6_pq snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi pcspkr snd_hda_codec libcrc32c crc64 snd_hda_core snd_hwdep snd_pcm snd_timer snd mei_me i2c_i801 lpc_ich i2c_smbus e1000e mei soundcore wmi mac_hid tcp_bbr uinput nvidia_drm(POE) nvidia_modeset(POE)
[15167.366003]  drm_kms_helper cec drm agpgart syscopyarea sysfillrect sysimgblt fb_sys_fops nvidia(POE) ipmi_devintf ipmi_msghandler vboxnetflt(OE) vboxnetadp(OE) vboxdrv(OE) crypto_user fuse ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 crc32c_intel xhci_pci
> dmesg | grep -i btrfs
[   20.089833] Btrfs loaded, crc32c=crc32c-intel, zoned=yes
[   20.090760] BTRFS: device label Backup devid 1 transid 6286 /dev/sda3 scanned by systemd-udevd (343)
[   20.263819] BTRFS info (device sda3): enabling auto defrag
[   20.263826] BTRFS info (device sda3): disk space caching is enabled
[   20.263827] BTRFS info (device sda3): has skinny extents
[   20.312354] BTRFS: device label Data devid 1 transid 78169 /dev/bcache0 scanned by systemd-udevd (360)
[   20.329275] BTRFS info (device bcache0): enabling auto defrag
[   20.329279] BTRFS info (device bcache0): disk space caching is enabled
[   20.329280] BTRFS info (device bcache0): has skinny extents
[   22.940838] BTRFS info (device bcache0): enabling ssd optimizations
[15167.365673]  btrfs_map_bio+0x19b/0x4b0 [btrfs]
[15167.365731]  btrfs_submit_data_bio+0xbd/0x210 [btrfs]
[15167.365768]  submit_one_bio+0x44/0x70 [btrfs]
[15167.365809]  extent_readahead+0x3b4/0x3e0 [btrfs]
[15167.365944] Modules linked in: udp_diag tcp_diag inet_diag xt_nat xt_tcpudp veth xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter bridge stp llc hid_logitech_hidpp joydev mousedev hid_logitech_dj usbhid snd_hda_codec_hdmi rfkill intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel vfat fat iTCO_wdt intel_pmc_bxt mxm_wmi intel_wmi_thunderbolt overlay iTCO_vendor_support kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd btrfs rapl intel_cstate snd_hda_codec_realtek intel_uncore snd_hda_codec_generic blake2b_generic ledtrig_audio xor bcache raid6_pq snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi pcspkr snd_hda_codec libcrc32c crc64 snd_hda_core snd_hwdep snd_pcm snd_timer snd mei_me i2c_i801 lpc_ich i2c_smbus e1000e mei soundcore wmi mac_hid tcp_bbr uinput nvidia_drm(POE) nvidia_modeset(POE)

duzun avatar May 06 '21 06:05 duzun

hi @duzun

you probably want to take a look at: https://lore.kernel.org/linux-bcache/2209740.ElGaqSPkdT@invader/T/#m9c2e56044894c9a348b49e7f64f77889e51764f6

the patch included there works in fixing bcache in linux kernel 5.12.

note: i think you want to be filing a bug report here -> https://bugzilla.kernel.org/ as this is a go library project.

alexjp avatar May 21 '21 17:05 alexjp

closing it because looks like it is wrong project

iwanbk avatar Nov 02 '22 04:11 iwanbk

Indeed, after next kernel version update, bcache works again. And yes, wrong project :) Thanks!

duzun avatar Nov 02 '22 06:11 duzun