f2fs: add missing f2fs_balance_fs in f2fs_zero_range
authorChao Yu <yuchao0@huawei.com>
Tue, 11 Oct 2016 14:57:02 +0000 (22:57 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 23 Nov 2016 20:10:52 +0000 (12:10 -0800)
f2fs_balance_fs should be called in between node page updating, otherwise
node page count will exceeded far beyond watermark of triggering
foreground garbage collection, result in facing high risk of hitting LFS
allocation failure.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 02372175725dc57c16bcbbd7ffcabd72cde226c3..578bc7bcaa13b724c8be8a36a026379501213164 100644 (file)
@@ -1218,6 +1218,9 @@ static int f2fs_zero_range(struct inode *inode, loff_t offset, loff_t len,
                        ret = f2fs_do_zero_range(&dn, index, end);
                        f2fs_put_dnode(&dn);
                        f2fs_unlock_op(sbi);
+
+                       f2fs_balance_fs(sbi, dn.node_changed);
+
                        if (ret)
                                goto out;