aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2011-11-18 17:43:00 +0800
committerDavid Sterba <dsterba@suse.cz>2011-11-30 18:46:03 +0100
commitaa38a711a893accf5b5192f3d705a120deaa81e0 (patch)
tree59dbb3bca55b7141ba0e0fda1031452ae87a6935 /fs/btrfs/inode.c
parentFix URL of btrfs-progs git repository in docs (diff)
downloadlinux-dev-aa38a711a893accf5b5192f3d705a120deaa81e0.tar.xz
linux-dev-aa38a711a893accf5b5192f3d705a120deaa81e0.zip
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>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 8ad26b135a1c..c5ccec23984c 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3490,7 +3490,7 @@ void btrfs_evict_inode(struct inode *inode)
* doing the truncate.
*/
while (1) {
- ret = btrfs_block_rsv_refill(root, rsv, min_size);
+ ret = btrfs_block_rsv_refill_noflush(root, rsv, min_size);
/*
* Try and steal from the global reserve since we will