]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChris Mason <chris.mason@oracle.com>
Fri, 16 Dec 2011 19:40:34 +0000 (14:40 -0500)
commit845d804f46cbc2a4bf020217ace1746c2282539f
tree149e85c892878fb4057e42e33fb638e25ff19f3b
parent19fb7ebde670b9c23ce81cf1ab224d47db0c4920
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>
(cherry picked from commit aa38a711a893accf5b5192f3d705a120deaa81e0)
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c