]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix repeated delalloc work allocation
authorMiao Xie <miaox@cn.fujitsu.com>
Tue, 22 Jan 2013 10:49:00 +0000 (10:49 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Thu, 24 Jan 2013 17:51:27 +0000 (12:51 -0500)
commit57a00b601c27d455f19f52cf0e1833b2d56f38d9
tree59ffd2a324039af64354fbaaaa116c9366acba6f
parent0f96baff8f295eb7bfb4e9e1af28c60e04d68fe1
Btrfs: fix repeated delalloc work allocation

btrfs_start_delalloc_inodes() locks the delalloc_inodes list, fetches the
first inode, unlocks the list, triggers btrfs_alloc_delalloc_work/
btrfs_queue_worker for this inode, and then it locks the list, checks the
head of the list again. But because we don't delete the first inode that it
deals with before, it will fetch the same inode. As a result, this function
allocates a huge amount of btrfs_delalloc_work structures, and OOM happens.

Fix this problem by splice this delalloc list.

Reported-by: Alex Lyakas <alex.btrfs@zadarastorage.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/inode.c