aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-09-01 12:02:51 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-09-12 10:30:41 -0700
commit7f3037a5ec0672e03f96d4b0b86169c4c48e479e (patch)
tree66b71b995cbd04ccfa395f6ac487c6204c03b32a /fs/f2fs/file.c
parentf2fs: forbid to do fstrim if fs has some error (diff)
downloadlinux-dev-7f3037a5ec0672e03f96d4b0b86169c4c48e479e.tar.xz
linux-dev-7f3037a5ec0672e03f96d4b0b86169c4c48e479e.zip
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>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 3b62949dfb07..b8a521f6c2d5 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1961,7 +1961,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
* avoid defragment running in SSR mode when free section are allocated
* intensively
*/
- if (has_not_enough_free_secs(sbi, sec_num)) {
+ if (has_not_enough_free_secs(sbi, 0, sec_num)) {
err = -EAGAIN;
goto out;
}