f2fs: fix wrong memory condition check
authorJaegeuk Kim <jaegeuk@kernel.org>
Sun, 10 Jan 2016 00:14:08 +0000 (16:14 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 11 Jan 2016 23:56:43 +0000 (15:56 -0800)
This patch fixes wrong decision for avaliable_free_memory.
The return valus is already set as false, so we should consider true condition
below only.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c

index c091b757bda6038bef89f7bb88ffd5fb4ba713f8..342597a5897f059a2d31823923d8664861b7b969 100644 (file)
@@ -71,8 +71,8 @@ bool available_free_memory(struct f2fs_sb_info *sbi, int type)
                                sizeof(struct extent_node)) >> PAGE_CACHE_SHIFT;
                res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1);
        } else {
-               if (sbi->sb->s_bdi->wb.dirty_exceeded)
-                       return false;
+               if (!sbi->sb->s_bdi->wb.dirty_exceeded)
+                       return true;
        }
        return res;
 }