Bug 60524
Summary: | WARNING: at fs/btrfs/inode.c:4745 inode_tree_add while defragmenting | ||
---|---|---|---|
Product: | File System | Reporter: | Grzegorz Kowal (custos.mentis) |
Component: | btrfs | Assignee: | Josef Bacik (josef) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | bastienphilbert, dsterba, szg00000 |
Priority: | P1 | ||
Hardware: | x86-64 | ||
OS: | Linux | ||
Kernel Version: | 3.9.9 + btrfs-next | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | syslog messages |
Description
Grzegorz Kowal
2013-07-05 21:45:12 UTC
Do you have snapshots or anything? Did you use any special options when making the file system? I've been running this command _a lot_ recently and I haven't seen this, so hopefully you are doing something different from me. Yes, I use read only snapshots, but I didn't use any special options when I created the file system. When I switched to kernel 3.9 I encountered the oops during defragmentation several times (__tree_mod_log_rewind bug reported in https://bugzilla.kernel.org/show_bug.cgi?id=56671), so I had to remove autodefrag option from my mount options. Do you think that the oopses during defragmentation could leave the file system in an unusual state? I see this message with a 3.11 based kernel, there are lots of backref messages like the following one. The system was freshly installed and running while true; do echo 3 > /proc/sys/vm/drop_caches find / -xdev -type f -exec md5sum '{}' + find / -xdev -type f -exec btrfs fi defrag -clzo '{}' \; btrfs fi balance start / btrfs scrub start -Bd / done [ 1336.674400] ------------[ cut here ]------------ [ 1336.674439] WARNING: CPU: 0 PID: 3802 at /home/abuild/rpmbuild/BUILD/kernel-desktop-3.11.1/linux-3.11/fs/btrfs/inode.c:2206 record_one_backref+0x379/0x420 [btrfs]() [ 1336.674486] CPU: 0 PID: 3802 Comm: btrfs-endio-wri Tainted: G W 3.11.1-1.g1383321-desktop #1 [ 1336.674489] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 1336.674492] 0000000000000009 ffffffff815a9297 0000000000000000 ffffffff81050e02 [ 1336.674497] ffff8800203a42e0 0000000000000001 ffff880079c33800 0000000000014c0b [ 1336.674502] ffff88003037b920 ffffffffa01638f9 00000000005c0000 0000000000000135 [ 1336.674507] Call Trace: [ 1336.674538] [<ffffffff81004988>] dump_trace+0x88/0x310 [ 1336.674546] [<ffffffff81004ce0>] show_stack_log_lvl+0xd0/0x1d0 [ 1336.674553] [<ffffffff8100612c>] show_stack+0x1c/0x50 [ 1336.674562] [<ffffffff815a9297>] dump_stack+0x50/0x89 [ 1336.674571] [<ffffffff81050e02>] warn_slowpath_common+0x72/0x90 [ 1336.674596] [<ffffffffa01638f9>] record_one_backref+0x379/0x420 [btrfs] [ 1336.674684] [<ffffffffa01b8716>] iterate_extent_inodes+0x1c6/0x320 [btrfs] [ 1336.674846] [<ffffffffa01b88f4>] iterate_inodes_from_logical+0x84/0xa0 [btrfs] [ 1336.675004] [<ffffffffa01620db>] record_extent_backrefs+0x6b/0xe0 [btrfs] [ 1336.675154] [<ffffffffa016c560>] btrfs_finish_ordered_io+0x150/0x990 [btrfs] [ 1336.675248] [<ffffffffa018cae9>] worker_loop+0x149/0x550 [btrfs] [ 1336.675351] [<ffffffff81071b1f>] kthread+0xaf/0xc0 [ 1336.675359] [<ffffffff815b6dfc>] ret_from_fork+0x7c/0xb0 [ 1336.675597] ---[ end trace 3960f2ebba1c6e7d ]--- and the inode_tree_add [ 1452.616673] ------------[ cut here ]------------ [ 1452.616695] WARNING: CPU: 0 PID: 3848 at /home/abuild/rpmbuild/BUILD/kernel-desktop-3.11.1/linux-3.11/fs/btrfs/inode.c:4746 inode_tree_add+0x135/0x140 [btrfs]() [ 1452.616719] CPU: 0 PID: 3848 Comm: btrfs-endio-wri Tainted: G W 3.11.1-1.g1383321-desktop #1 [ 1452.616721] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 1452.616722] 0000000000000009 ffffffff815a9297 0000000000000000 ffffffff81050e02 [ 1452.616725] ffff880009d40448 ffff880024aed4a8 ffff880024aed4b0 0000000000007f95 [ 1452.616727] ffff88002ac108b8 ffffffffa0162285 ffff88002ac108b8 ffff880003f2d420 [ 1452.616729] Call Trace: [ 1452.616772] [<ffffffff81004988>] dump_trace+0x88/0x310 [ 1452.616772] [<ffffffff81004ce0>] show_stack_log_lvl+0xd0/0x1d0 [ 1452.616788] [<ffffffff8100612c>] show_stack+0x1c/0x50 [ 1452.616788] [<ffffffff815a9297>] dump_stack+0x50/0x89 [ 1452.616788] [<ffffffff81050e02>] warn_slowpath_common+0x72/0x90 [ 1452.616807] [<ffffffffa0162285>] inode_tree_add+0x135/0x140 [btrfs] [ 1452.616822] [<ffffffffa016b3af>] btrfs_iget+0x11f/0x530 [btrfs] [ 1452.616862] [<ffffffffa016bd38>] relink_extent_backref+0xd8/0x7b0 [btrfs] [ 1452.616922] [<ffffffffa016c609>] btrfs_finish_ordered_io+0x1f9/0x990 [btrfs] [ 1452.616963] [<ffffffffa018cae9>] worker_loop+0x149/0x550 [btrfs] [ 1452.617083] [<ffffffff81071b1f>] kthread+0xaf/0xc0 [ 1452.617119] [<ffffffff815b6dfc>] ret_from_fork+0x7c/0xb0 [ 1452.617119] ---[ end trace 3960f2ebba1c6e82 ]--- Created attachment 109301 [details]
syslog messages
I am currently on kernel 3.10.12 (without btrfs-next patches) and the warning still shows up: [57713.010355] ------------[ cut here ]------------ [57713.010371] WARNING: at fs/btrfs/inode.c:4864 inode_tree_add+0x164/0x170() [57713.010373] Modules linked in: usb_storage ipv6 bbswitch(O) rfcomm xt_tcpudp nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter ip_tables x_tables uvcvideo videobuf2_vmalloc videobuf2_memops psmouse btusb coretemp pcspkr microcode snd_hda_codec_realtek iwldvm mac80211 videobuf2_core bluetooth videodev crc16 snd_hda_intel snd_hda_codec snd_hwdep iwlwifi cfg80211 snd_pcm snd_page_alloc xhci_hcd mei_me r8169 mei [last unloaded: nvidia] [57713.010409] CPU: 1 PID: 18438 Comm: btrfs-endio-wri Tainted: P AW O 3.10.12-acrux #1 [57713.010411] Hardware name: ASUSTeK Computer Inc. U36JC/U36JC, BIOS U36JC.206 02/25/2011 [57713.010413] ffffffff815ab2ba 0000000000000000 ffffffff8103a4cc ffff88000e1e0138 [57713.010416] 0000000000009c04 ffff880015339580 ffff88018a5e24a0 ffff88018a5e24a8 [57713.010419] ffffffff81247ec4 ffff880015339580 ffff88024277c630 ffff88018a5e2000 [57713.010422] Call Trace: [57713.010428] [<ffffffff815ab2ba>] ? dump_stack+0xd/0x17 [57713.010432] [<ffffffff8103a4cc>] ? warn_slowpath_common+0x6c/0xa0 [57713.010435] [<ffffffff81247ec4>] ? inode_tree_add+0x164/0x170 [57713.010437] [<ffffffff81251d97>] ? btrfs_iget+0x147/0x550 [57713.010439] [<ffffffff812522c1>] ? relink_extent_backref+0x121/0x810 [57713.010444] [<ffffffff815a8700>] ? __slab_free+0x13a/0x2a2 [57713.010447] [<ffffffff81252ba9>] ? btrfs_finish_ordered_io+0x1f9/0x990 [57713.010451] [<ffffffff812728e1>] ? worker_loop+0x151/0x530 [57713.010455] [<ffffffff815af0ea>] ? schedule+0x60a/0xdf0 [57713.010458] [<ffffffff81272790>] ? btrfs_queue_worker+0x330/0x330 [57713.010462] [<ffffffff8105e7e3>] ? kthread+0xb3/0xc0 [57713.010464] [<ffffffff8105e730>] ? flush_kthread_work+0x100/0x100 [57713.010467] [<ffffffff815b132c>] ? ret_from_fork+0x7c/0xb0 [57713.010469] [<ffffffff8105e730>] ? flush_kthread_work+0x100/0x100 [57713.010471] ---[ end trace ef8f28bab661051a ]--- I don't known if your still having issues with this but if your try adding this line before the return statement in the function, btrfs_iget_locked for the file fs/btrfs/inode.c: inode->i_state |= I_WILL_FREE | I_FREEING This has been fixed long time ago, besides that such messing with I_ flags is dangerous. |