Gentoo Archives: gentoo-user

From: "Håkon Alstadheim" <hakon@×××××××××××××××.no>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Warnings on shutting down bcache: WARNING: CPU: 1 PID: 4378 at lib/idr.c:383
Date: Tue, 15 Aug 2017 12:07:52
Message-Id: a59533c7-6197-a1e2-da53-7eb7d7fcc617@alstadheim.priv.no
1 I'm getting some noise in my logs when shutting down bcache.
2 My system:
3 Linux gentoo 4.12.7-gentoo #1 SMP Sun Aug 13 22:56:20 CEST 2017 x86_64
4 Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz GenuineIntel GNU/Linux
5 Running as dom0 under Xen-4.9.0
6
7 My shutdown script loops over the bcache devices like so:
8 ---
9 for f in /sys/fs/bcache/854fc80e-5499-413f-b90b-87a803eaca7e/bdev*; do
10 bdev=$(basename $f )
11 if [ -e $f/stop ]; then
12 logger -t "init.d/probe-home-partition" -p daemon.warning\
13 "Stopping $bdev"
14 einfo "Stopping $bdev"
15 if ! echo 1 > $f/stop ; then
16 ewarn "Could not stop $bdev"
17 logger -t "init.d/probe-home-partition" -p daemon.warning\
18 "Could not stop $bdev"
19 fi
20 usleep 300
21 sleep 1
22 else
23 einfo "$bdev not cached?"
24 logger -t "init.d/probe-home-partition" -p daemon.warning \
25 "$bdev not cached ?"
26 fi
27 done
28
29 -----
30 This gives me in daemon.log:
31 -----
32 Aug 14 09:31:21 gentoo init.d/probe-home-partition: Stopping bdev15
33 Aug 14 09:31:22 gentoo init.d/probe-home-partition: Stopping bdev16
34 Aug 14 09:31:23 gentoo init.d/probe-home-partition: Stopping bdev17
35 Aug 14 09:31:24 gentoo init.d/probe-home-partition: Stopping bdev18
36 Aug 14 09:31:25 gentoo init.d/probe-home-partition: Stopping bdev19
37 Aug 14 09:31:26 gentoo init.d/probe-home-partition: Stopping cache set
38 -----
39 But it seems bcache is doing something weird, stopping a device called
40 bcache0, which I do not have, before stopping the first of my bcache
41 devices. ALL runs of "echo 1 > $device/stop" provoke a warning in
42 lib/idr.c on that same line. It may be that my stopping of the bcache
43 devices is wrong, un-necessary and misguided, but it should still work
44 the way I am doing it, should it not?
45
46
47 ---kern.log:---
48 ...
49 [140395.421994] nfsd: last server has exited, flushing export cache
50 [140397.011932] XFS (bcache16): Unmounting Filesystem
51 [140397.248911] bcache: bcache_device_free() bcache0 stopped
52 [140398.300187] bcache: bcache_device_free() bcache16 stopped
53 [140398.381951] ida_remove called for id=16 which is not allocated.
54 [140398.381975] ------------[ cut here ]------------
55 [140398.381985] WARNING: CPU: 1 PID: 4378 at lib/idr.c:383
56 ida_remove+0xde/0xef
57 [140398.381987] Modules linked in: xt_physdev iptable_filter ip_tables
58 x_tables nfsd auth_rpcgss oid_registry nfsv4 dns_resolver nfsv3 nfs_acl
59 iTCO_wdt iTCO_vendor_support binfmt_misc tun usbip_host usbip_core
60 pktcdvd xen_wdt xen_blkback intel_rapl amdgpu intel_powerclamp
61 crc32c_intel serio_raw drm_kms_helper pcspkr syscopyarea sysfillrect
62 sysimgblt fb_sys_fops ttm lpc_ich i2c_i801 snd_hda_codec_realtek drm
63 snd_hda_codec_generic bcache snd_usb_audio snd_usbmidi_lib snd_hda_intel
64 snd_rawmidi snd_hda_codec snd_seq_device snd_hwdep snd_hda_core snd_pcm
65 snd_timer snd cp210x usbserial nct6775 input_leds hwmon_vid shpchp
66 ipmi_ssif wmi acpi_power_meter dm_zero dm_thin_pool dm_persistent_data
67 dm_bio_prison dm_service_time dm_round_robin dm_queue_length
68 dm_multipath dm_log_userspace cn virtio_pci virtio_scsi
69 [140398.382056] virtio_blk virtio_console virtio_balloon xts aes_x86_64
70 cbc sha512_generic sha1_generic libiscsi scsi_transport_iscsi macvlan
71 virtio_net virtio_ring virtio e1000 fuse overlay nfs lockd grace sunrpc
72 fscache jfs multipath linear raid10 raid1 raid0 dm_raid raid456
73 async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq
74 dm_snapshot dm_bufio dm_crypt dm_mirror dm_region_hash dm_log dm_mod dax
75 hid_sunplus hid_sony hid_samsung hid_pl hid_petalynx hid_monterey
76 hid_microsoft hid_logitech ff_memless hid_gyration hid_ezkey hid_cypress
77 hid_chicony hid_cherry hid_a4tech sl811_hcd xhci_plat_hcd ohci_pci
78 ohci_hcd uhci_hcd aic94xx lpfc qla2xxx aacraid sx8 DAC960 hpsa cciss
79 3w_9xxx 3w_xxxx mptsas mptfc scsi_transport_fc mptspi mptscsih mptbase
80 atp870u dc395x qla1280 imm parport dmx3191d
81 [140398.382139] sym53c8xx gdth initio BusLogic arcmsr aic7xxx aic79xx
82 sg pdc_adma sata_inic162x sata_mv sata_qstor sata_vsc sata_uli sata_sis
83 sata_sx4 sata_nv sata_via sata_svw sata_sil24 sata_sil sata_promise
84 pata_sis usbhid led_class igb ptp dca i2c_algo_bit ehci_pci ehci_hcd
85 xhci_pci megaraid_sas xhci_hcd
86 [140398.382175] CPU: 1 PID: 4378 Comm: kworker/1:2 Not tainted
87 4.12.6-gentoo #1
88 [140398.382177] Hardware name: ASUSTeK COMPUTER INC. Z10PE-D8
89 WS/Z10PE-D8 WS, BIOS 3407 03/10/2017
90 [140398.382190] Workqueue: events cached_dev_free [bcache]
91 [140398.382193] task: ffff880216b24240 task.stack: ffffc900431e4000
92 [140398.382197] RIP: e030:ida_remove+0xde/0xef
93 [140398.382199] RSP: e02b:ffffc900431e7db0 EFLAGS: 00010082
94 [140398.382202] RAX: 0000000000000033 RBX: 0000000000000012 RCX:
95 0000000000000000
96 [140398.382204] RDX: ffff880249654450 RSI: ffff88024964dc08 RDI:
97 ffff88024964dc08
98 [140398.382205] RBP: ffffc900431e7e10 R08: 0000000000000000 R09:
99 00000000000448da
100 [140398.382207] R10: 0000000000001668 R11: ffffffff81f1dad0 R12:
101 ffffffffc08114c8
102 [140398.382209] R13: ffffffffc08114c0 R14: 00000000000000fa R15:
103 0000000000000010
104 [140398.382223] FS: 0000000000000000(0000) GS:ffff880249640000(0000)
105 knlGS:ffff880249640000
106 [140398.382225] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033
107 [140398.382227] CR2: 00007fb681059eb0 CR3: 000000020a7b9000 CR4:
108 0000000000042660
109 [140398.382230] Call Trace:
110 [140398.382238] ida_simple_remove+0x2f/0x45
111 [140398.382247] bcache_device_free+0x8c/0xc4 [bcache]
112 [140398.382255] cached_dev_free+0x6b/0xe1 [bcache]
113 [140398.382261] process_one_work+0x16f/0x281
114 [140398.382265] ? rescuer_thread+0x24e/0x24e
115 [140398.382268] worker_thread+0x1a4/0x257
116 [140398.382272] ? rescuer_thread+0x24e/0x24e
117 [140398.382275] kthread+0xfc/0x101
118 [140398.382278] ? init_completion+0x24/0x24
119 [140398.382284] ret_from_fork+0x25/0x30
120 [140398.382287] Code: 00 75 2a 4c 89 f7 e8 79 52 d5 ff 48 8d 75 b0 4c 89
121 e2 4c 89 ef e8 03 3a 00 00 eb 11 44 89 fe 48 c7 c7 0a a1 a0 81 e8 c9 79
122 d0 ff <0f> ff 48 83 c4 38 5b 41 5c 41 5d 41 5e 41 5f 5d c3 85 f6 79 02
123 [140398.382341] ---[ end trace 279bbc0d0aae56cc ]---
124 ----

Replies