f2fs: fix inconsistent using of NM_WOUT_THRESHOLD
authorHaicheng Li <haicheng.li@linux.intel.com>
Sun, 28 Apr 2013 11:16:06 +0000 (19:16 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 30 Apr 2013 03:07:32 +0000 (12:07 +0900)
commit6cac3759ce118a87103ce4342e6de98215d01787
treeea597bcaf02e80a3b09d5e4a46c8d812c211d890
parentafcb7ca01f47b0481e0b248d1542d0934fa70767
f2fs: fix inconsistent using of NM_WOUT_THRESHOLD

try_to_free_nats() is usually called with parameter nr_shrink as
"nm_i->nat_cnt - NM_WOUT_THRESHOLD"
by flush_nat_entries() during checkpointing process.

However, this is inconsistent with the actual threshold check as
"if (nm_i->nat_cnt < 2 * NM_WOUT_THRESHOLD)"
, which will ignore the free_nats requests when
NM_WOUT_THRESHOLD < nm_i->nat_cnt < 2 * NM_WOUT_THRESHOLD

So fix the threshold check condition.

Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/node.c