f2fs: check free_sections for defragmentation

Fix wrong condition check for defragmentation of a file.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim
2016-09-01 12:02:51 -07:00
parent ed214a1183
commit 7f3037a5ec
5 changed files with 15 additions and 14 deletions

View File

@@ -1293,7 +1293,7 @@ write:
if (!wbc->for_reclaim)
need_balance_fs = true;
else if (has_not_enough_free_secs(sbi, 0))
else if (has_not_enough_free_secs(sbi, 0, 0))
goto redirty_out;
err = -EAGAIN;
@@ -1625,7 +1625,7 @@ repeat:
if (err)
goto fail;
if (need_balance && has_not_enough_free_secs(sbi, 0)) {
if (need_balance && has_not_enough_free_secs(sbi, 0, 0)) {
unlock_page(page);
f2fs_balance_fs(sbi, true);
lock_page(page);