Skip to contentSkip to conversation

Warning in inode_tree_add() -- !(entry->vfs_inode.i_state & (I_WILL_FREE | I_FREEING)

DISCUSSION Pedro Fonseca 2 participants 3 messages Dec 9, 2013 – Dec 10, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hi,

I've got multiple instances of warnings caused by the statement "WARN_ON(!(entry->vfs_inode.i_state & (I_WILL_FREE | I_FREEING)));" in inode_tree_add(). The tests were executed on the official 3.12.2 kernel. Do you think it's something serious?

Pedro

Warning message (for test 1):

Quoted 20 lines
[  257.691419] btrfs: new size for /dev/loop0 is 308281344
[  271.929976] ------------[ cut here ]------------
[  271.945240] WARNING: CPU: 0 PID: 2726 at /local/pfonseca/piking/kernel-build/linux-3.12.2-fs-static2/fs/btrfs/inode.c:4709 inode_tree_add+0x89/0xd9()
[  271.949424] Modules linked in: loop rtc_cmos tpm_tis freq_table pcspkr i2c_piix4
[  271.951685] CPU: 0 PID: 2726 Comm: btrfs-endio-wri Not tainted 3.12.2 #2
[  271.952213] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[  271.952879]  00000000 00000000 c53d5d58 c16415c4 00000000 c53d5d70 c102b699 c11edd24
[  271.953485]  d952e8d4 c4e6ac00 d9548458 c53d5d80 c102b6bf 00000009 00000000 c53d5da4
[  271.953995]  c11edd24 00000000 00000109 c4e6af9c d95483e4 d9548458 00000109 00000000
[  271.954594] Call Trace:
[  271.955905]  [<c16415c4>] dump_stack+0x41/0x52
[  271.956200]  [<c102b699>] warn_slowpath_common+0x5c/0x73
[  271.956474]  [<c11edd24>] ? inode_tree_add+0x89/0xd9
[  271.956716]  [<c102b6bf>] warn_slowpath_null+0xf/0x13
[  271.956959]  [<c11edd24>] inode_tree_add+0x89/0xd9
[  271.957196]  [<c11f4c5f>] btrfs_iget+0x39c/0x3d6
[  271.957433]  [<c11f4d9f>] relink_extent_backref+0x106/0x67c
[  271.957698]  [<c12321a9>] ? iterate_inodes_from_logical+0x7d/0x93
[  271.957975]  [<c11eeb00>] ? btrfs_clear_bit_hook+0x1bb/0x1f9
[  271.958251]  [<c11f5b02>] btrfs_finish_ordered_io+0x7ed/0x8ad
Quoted 8 lines
[  271.958525]  [<c102e851>] ? irq_exit+0x42/0x44
[  271.959161]  [<c11f5bcd>] finish_ordered_fn+0xb/0xd
[  271.959404]  [<c121003c>] worker_loop+0xf5/0x3d1
[  271.959643]  [<c120ff47>] ? btrfs_queue_worker+0x1e4/0x1e4
[  271.959898]  [<c103e612>] kthread+0x6e/0x73
[  271.960122]  [<c1648797>] ret_from_kernel_thread+0x1b/0x28
[  271.960378]  [<c103e5a4>] ? __kthread_parkme+0x54/0x54
[  271.961028] ---[ end trace 00b972e1196e8ac0 ]---

* Test 1:

Quoted 7 lines
    CPU: 1 Op: dread
    CPU: 1 Op: chown
    CPU: 1 Op: dwrite
CPU: 0 Op: chown
CPU: 0 Op: rmdir
CPU: 0 Op: chown
CPU: 0 Op: chown
Quoted 8 lines
CPU: 0 Op: chown
CPU: 0 Op: btrfs_subvol_list
CPU: 0 Op: btrfs_ioctl_filesystem_resize
    CPU: 1 Op: write
    CPU: 1 Op: read
    CPU: 1 Op: dwrite
    CPU: 1 Op: dread
    CPU: 1 Op: btrfs_ioctl_filesystem_defragment

* Test 2:

Quoted 8 lines
    CPU: 1 Op: dread
    CPU: 1 Op: chown
    CPU: 1 Op: dwrite
    CPU: 1 Op: write
    CPU: 1 Op: read
    CPU: 1 Op: dwrite
CPU: 0 Op: dread
CPU: 0 Op: chown
Quoted 8 lines
CPU: 0 Op: dwrite
    CPU: 1 Op: dread
    CPU: 1 Op: btrfs_ioctl_filesystem_defragment
CPU: 0 Op: write
CPU: 0 Op: read
CPU: 0 Op: dwrite
CPU: 0 Op: dread
CPU: 0 Op: btrfs_ioctl_filesystem_defragment

* Test 3:

Quoted 16 lines
    CPU: 1 Op: dread
    CPU: 1 Op: stat
    CPU: 1 Op: btrfs_ioctl_filesystem_resize
    CPU: 1 Op: write
    CPU: 1 Op: mkdir
    CPU: 1 Op: creat
    CPU: 1 Op: chown
    CPU: 1 Op: rename
CPU: 0 Op: dread
CPU: 0 Op: chown
CPU: 0 Op: dwrite
CPU: 0 Op: write
CPU: 0 Op: read
CPU: 0 Op: dwrite
CPU: 0 Op: dread
CPU: 0 Op: btrfs_ioctl_filesystem_defragment
#1 lore raw

Quoting Pedro Fonseca (2013-12-09 16:15:46)

Quoted 6 lines

Hi,

I've got multiple instances of warnings caused by the statement "WARN_ON(!(entry->vfs_inode.i_state & (I_WILL_FREE | I_FREEING)));" in inode_tree_add(). The tests were executed on the official 3.12.2 kernel. Do you think it's something serious?

Definitely. You're in the autodefrag code here and an iget is replacing an existing inode that wasn't ready to be replaced. What test are you running?

-chris

#2 lore raw
Quoted 8 lines · Chris Mason

Quoting Pedro Fonseca (2013-12-09 16:15:46)

Quoted 6 lines

Hi,

I've got multiple instances of warnings caused by the statement "WARN_ON(!(entry->vfs_inode.i_state & (I_WILL_FREE | I_FREEING)));" in inode_tree_add(). The tests were executed on the official 3.12.2 kernel. Do you think it's something serious?

Quoted 6 lines

Definitely. You're in the autodefrag code here and an iget is replacing an existing inode that wasn't ready to be replaced. What test are you running?

-chris

I'm running a custom test based on fsstress and on a QEMU based VMM. Btrfs was statically compiled and the btrfs filesystem was mounted on one or two loop devices.

Bellow I've tried to annotate the last file system operations with their parameters (e.g., "filename", "[start, len]",...). Note that the log only specifies the starting order of the operations and note that operations on different CPUs may overlap (i.e. execute concurrently).

Let me know if you need additional information.

Pedro

* Test 1:

     CPU: 1 Op: dread (d16/f22 [233472,90112])
     CPU: 1 Op: chown  (d16/da6/c111)
     CPU: 1 Op: dwrite (d16/d21/d38/fad [299008,65536])
 CPU: 0 Op: chown (d16/da6/fe2)
 CPU: 0 Op: rmdir (d16/d21/d6d/d74 39)
 CPU: 0 Op: chown (fb)
 CPU: 0 Op: chown (d16/d21/f96)
 CPU: 0 Op: chown (d16/d21/d38/f66)
 CPU: 0 Op: btrfs_subvol_list (d16)
 CPU: 0 Op: btrfs_ioctl_filesystem_resize (+8m /mnt/dir)
     CPU: 1 Op: write (d16/d21/d6d/feb [1581147,53815])
     CPU: 1 Op: read (d16/d21/fc2 [159384,10768])
     CPU: 1 Op: dwrite (f12 [1990656,90112])
     CPU: 1 Op: dread (d16/d21/d6d/fa4 zero size)
     CPU: 1 Op: btrfs_ioctl_filesystem_defragment (d16/f22)

* Test 2:

     CPU: 1 Op: dread (d16/f22 [233472,90112])
     CPU: 1 Op: chown (d16/da6/c111)
     CPU: 1 Op: dwrite (d16/d21/d38/fad [299008,65536])
     CPU: 1 Op: write (d16/d21/d6d/feb [1581147,53815])
     CPU: 1 Op: read (d16/d21/fc2 [159384,10768])
     CPU: 1 Op: dwrite (f12 [1990656,90112])
 CPU: 0 Op: dread (d16/f22 [233472,90112])
 CPU: 0 Op: chown (d16/da6/c111)
 CPU: 0 Op: dwrite (d16/d21/d38/fad [299008,65536])
     CPU: 1 Op: dread (d16/d21/d6d/fa4 zero size)
     CPU: 1 Op: btrfs_ioctl_filesystem_defragment (d16/f22)
 CPU: 0 Op: write (d16/d21/d6d/feb [2193555,53815])
 CPU: 0 Op: read (d16/d21/fc2 [159384,10768])
 CPU: 0 Op: dwrite (f12 [688128,90112])
 CPU: 0 Op: dread (d16/d21/d6d/fa4 zero size)
 CPU: 0 Op: btrfs_ioctl_filesystem_defragment (d16/f22)

* Test 3:

     CPU: 1 Op: dread (d16/dce/fe1 zero size)
     CPU: 1 Op: stat (stat d16/da6/f117)
     CPU: 1 Op: btrfs_ioctl_filesystem_resize (-5m /mnt/dir)
     CPU: 1 Op: write (ff [956340,50300])
     CPU: 1 Op: mkdir (d16/d13b)
     CPU: 1 Op: creat (d16/d21/d6d/d74/f13c x:0 0 0)
     CPU: 1 Op: chown (d16/f116)
     CPU: 1 Op: rename ( d16/d21/d38/l7c to d16/d21/d38/l13d)
 CPU: 0 Op: dread (d16/f22 [233472,90112])
 CPU: 0 Op: chown (d16/da6/c111)
 CPU: 0 Op: dwrite (d16/d21/d38/fad [299008,65536])
 CPU: 0 Op: write (d16/d21/d6d/feb [1581147,53815])
 CPU: 0 Op: read (d16/d21/fc2 [159384,10768])
 CPU: 0 Op: dwrite (f12 [1990656,90112])
 CPU: 0 Op: dread (d16/d21/d6d/fa4 zero size)
 CPU: 0 Op: btrfs_ioctl_filesystem_defragment (d16/f22)