]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix deadlock on metadata reservation when evicting a inode
authorMiao Xie <miaox@cn.fujitsu.com>
Fri, 18 Nov 2011 09:43:00 +0000 (17:43 +0800)
committerDavid Sterba <dsterba@suse.cz>
Wed, 30 Nov 2011 17:46:03 +0000 (18:46 +0100)
commitee03a2f34f709f513cf708360ade85679a75d6bb
tree59dbb3bca55b7141ba0e0fda1031452ae87a6935
parent5be3a6b1196e03c81b4d5b01d22f6ad0ef3ef71a
Btrfs: fix deadlock on metadata reservation when evicting a inode

When I ran the xfstests, I found the test tasks was blocked on meta-data
reservation.

By debugging, I found the reason of this bug:
   start transaction
        |
v
   reserve meta-data space
|
v
   flush delay allocation -> iput inode -> evict inode
^ |
| v
   wait for delay allocation flush <- reserve meta-data space

And besides that, the flush on evicting inode will block the thread, which
is reclaiming the memory, and make oom happen easily.

Fix this bug by skipping the flush step when evicting inode.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c