Skip to contentSkip to conversation

kernel BUG at fs/btrfs/inode.c:2260!

DISCUSSION James Cloos 2 participants 3 messages May 30, 2011 – Jun 10, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

I got this today, running 2.6.39-07159-gf23a5e1.

The fs in question is mounted:

/dev/sdXX on /usr/local/portage type btrfs (rw,noatime,compress=zlib)

The BUG_ON() call is from:

        if (!BTRFS_I(inode)->orphan_meta_reserved) {
                BTRFS_I(inode)->orphan_meta_reserved = 1;
                reserve = 1;
        }
/* *ELIDED* */
        /* grab metadata reservation from transaction handle */
        if (reserve) {
                ret = btrfs_orphan_reserve_metadata(trans, inode);
                BUG_ON(ret);
        }

and I cannot umount(8) that fs since this. It claims to be in use.

A du(1) gets stuck but remains interuptable and quits cleanly when signaled.

The load at the time of the BUG_ON(), for that fs, had significant file creation, deletion and replacement. It had previously (this boot) been remotely mounted with nfs, but was not at the time of the BUG_ON().

------------[ cut here ]------------
kernel BUG at fs/btrfs/inode.c:2260!
invalid opcode: 0000 [#1] PREEMPT SMP 
CPU 1 
Modules linked in: k10temp

Pid: 1343, comm: g-common Not tainted 2.6.39-07159-gf23a5e1 #57 MSI MS-7642/890GXM-G65 (MS-7642)

RIP: 0010:[<ffffffff8124144d>]  [<ffffffff8124144d>] btrfs_orphan_add+0xfa/0x13c
RSP: 0018:ffff88001a51bdd8  EFLAGS: 00010286
RAX: 00000000ffffffe4 RBX: ffff8802fb8e9000 RCX: ffff8802bd624530
RDX: 0000000000000000 RSI: ffff8802bd624530 RDI: ffff88001a51a000
RBP: ffff88001a51be18 R08: ffff880103c890b8 R09: ffff88001a51bdb8
R10: ffffffff8162facd R11: ffff8802f8b6c108 R12: ffff8802e58da160
R13: ffff8802e599fa80 R14: 0000000000000000 R15: 0000000000000001
FS:  00007f13ece50700(0000) GS:ffff88030fc40000(0000) knlGS:00000000557516c0
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f9d29db4f68 CR3: 0000000103a1b000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process g-common (pid: 1343, threadinfo ffff88001a51a000, task ffff8802bd624530)
Stack:
 ffff8802fb8e9388 00000001fb8e9000 ffff88001a51be18 ffff8802e599fa80
 0000000000000000 ffff8802e58d9d68 ffff8802e58da160 ffff8802fb8e9000
 ffff88001a51be58 ffffffff81243bb1 ffff880007dc2900 ffff880007dc2900
Call Trace:
 [<ffffffff81243bb1>] btrfs_unlink+0x8e/0xbe
 [<ffffffff8111f5af>] vfs_unlink+0x6d/0xb7
 [<ffffffff8112b0f2>] ? mnt_want_write+0x71/0x81
 [<ffffffff8111f911>] do_unlinkat+0xce/0x155
 [<ffffffff81117bde>] ? sys_newlstat+0x2a/0x33
 [<ffffffff81120375>] sys_unlink+0x16/0x18
 [<ffffffff816328d2>] system_call_fastpath+0x16/0x1b
Code: 3e 00 4d 85 f6 74 0f 48 8b bb 20 01 00 00 4c 89 f6 e8 69 bc fe ff 83 7d cc 00 74 11 4c 89 e6 4c 89 ef e8 7c bf fe ff 85 c0 74 02 <0f> 0b 41 ff cf 75 2a 49 8b 94 24 68 fe ff ff 48 81 fa 00 01 00 
RIP  [<ffffffff8124144d>] btrfs_orphan_add+0xfa/0x13c
 RSP <ffff88001a51bdd8>
---[ end trace f858840206b4cbb6 ]---

-JimC

Signature · 1 line
James Cloos <[email protected]>         OpenPGP: 1024D/ED7DAEA6
#1 lore raw

Hi,

Quoted 11 lines · James Cloos

The BUG_ON() call is from:

        if (!BTRFS_I(inode)->orphan_meta_reserved) {
                BTRFS_I(inode)->orphan_meta_reserved = 1;
                reserve = 1;
        }
/* *ELIDED* */
        /* grab metadata reservation from transaction handle */
        if (reserve) {
                ret = btrfs_orphan_reserve_metadata(trans, inode);
                BUG_ON(ret);

ret == -ENOSPC

Quoted 3 lines
        }

and I cannot umount(8) that fs since this. It claims to be in use.

system is in undefined state after hitting a BUG_ON, there may be locked spinlocks/mutexes, held references, etc, causing hangs eg. during sync.

Quoted 2 lines

A du(1) gets stuck but remains interuptable and quits cleanly when signaled.

one can have a look at /proc/<pid>/stack where the process is stuck, and what locks are being held, probably with TASK_INTERRUPTIBLE. but this will not help anyhow.

Quoted 10 lines
------------[ cut here ]------------
kernel BUG at fs/btrfs/inode.c:2260!
invalid opcode: 0000 [#1] PREEMPT SMP 
CPU 1 
Modules linked in: k10temp

Pid: 1343, comm: g-common Not tainted 2.6.39-07159-gf23a5e1 #57 MSI MS-7642/890GXM-G65 (MS-7642)

RIP: 0010:[<ffffffff8124144d>]  [<ffffffff8124144d>] btrfs_orphan_add+0xfa/0x13c
RSP: 0018:ffff88001a51bdd8  EFLAGS: 00010286
RAX: 00000000ffffffe4 RBX: ffff8802fb8e9000 RCX: ffff8802bd624530
       ^^^^^^^^^^^^^^^^

confirmed, -ENOSPC == -28

david

#2 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"DS" == David Sterba <[email protected]> writes:

DS> confirmed, -ENOSPC == -28

So not a novel BUG_ON() after all.

On the plus side, it has not re-appeared in the 3.0 rc's.

That (4 Gig) fs currently has:

:; find /usr/local/portage|wc -l
444073

:; df /usr/local/portage
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda12 4194304 1278124 1767252 42% /usr/local/portage

:; btrfs filesystem df /usr/local/portage/
Data: total=1.21GB, used=822.17MB
System: total=4.00MB, used=4.00KB
Metadata: total=1.51GB, used=426.00MB

Most of the files are quite small, even before compression. About 40% are directories.

I've never run balance or defragment on that filesystem. Should I?

(It is a single-disk, single-partition fs; it has no subvolumes; it is mounted with rw,noatime,compress=zlib; it is in exports and does get mounted over nfs3.)

(I take it balance is for multi-device applications? --help uses the singular 'the device' but the btrfs(8) man page uses the plural 'the devices'....)

-JimC

Signature · 1 line
James Cloos <[email protected]>         OpenPGP: 1024D/ED7DAEA6