btrfs: Support busy loop of write and delete
authorZhao Lei <zhaolei@cn.fujitsu.com>
Mon, 2 Mar 2015 11:32:20 +0000 (19:32 +0800)
committerChris Mason <clm@fb.com>
Mon, 13 Apr 2015 14:31:10 +0000 (07:31 -0700)
commitc99f1b0c6c45d1621f08afb1352689e24a627844
tree2b890b3bc3ffbd5e0e06b13f95455760d7c71212
parentd7c151717a1efe289aec29fb9f94485f64262c0b
btrfs: Support busy loop of write and delete

Reproduce:
 while true; do
   dd if=/dev/zero of=/mnt/btrfs/file count=[75% fs_size]
   rm /mnt/btrfs/file
 done
 Then we can see above loop failed on NO_SPACE.

It it long-term problem since very beginning, because delayed-iput
after rm are not run.

We already have commit_transaction() in alloc_space code, but it is
not triggered in above case.
This patch trigger commit_transaction() to run delayed-iput and
reflash pinned-space to to make write success.

It is based on previous fix of delayed-iput in commit_transaction(),
need to be applied on top of:
btrfs: Fix NO_SPACE bug caused by delayed-iput

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent-tree.c