diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-04-09 12:34:43 +0800 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-04-13 17:14:26 -0400 |
commit | 42bd8f4fda813558c3045c60ad6436b1c7430ec7 (patch) | |
tree | 784996408d5c4895eea0b7b50604bd61da9ec309 /kernel/Kconfig.preempt | |
parent | ee6ad435c9872610c5a52cad02e331951cf2fb25 (diff) |
btrfs: wait for delayed iputs on no space
[ Upstream commit 9a4e7276d39071576d369e607d7accb84b41d0b4 ]
btrfs will report no_space when we run following write and delete
file loop:
# FILE_SIZE_M=[ 75% of fs space ]
# DEV=[ some dev ]
# MNT=[ some dir ]
#
# mkfs.btrfs -f "$DEV"
# mount -o nodatacow "$DEV" "$MNT"
# for ((i = 0; i < 100; i++)); do dd if=/dev/zero of="$MNT"/file0 bs=1M count="$FILE_SIZE_M"; rm -f "$MNT"/file0; done
#
Reason:
iput() and evict() is run after write pages to block device, if
write pages work is not finished before next write, the "rm"ed space
is not freed, and caused above bug.
Fix:
We can add "-o flushoncommit" mount option to avoid above bug, but
it have performance problem. Actually, we can to wait for on-the-fly
writes only when no-space happened, it is which this patch do.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'kernel/Kconfig.preempt')
0 files changed, 0 insertions, 0 deletions