From: Jaegeuk Kim Date: Sun, 10 Jan 2016 00:14:08 +0000 (-0800) Subject: f2fs: fix wrong memory condition check X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1663cae48ce3ce991c0e3f1a6fbdbd57f3dce9af;p=openwrt%2Fstaging%2Fblogic.git f2fs: fix wrong memory condition check 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 --- diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index c091b757bda6..342597a5897f 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -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; }