diff options
author | Haicheng Li <haicheng.li@linux.intel.com> | 2013-04-28 13:16:06 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-30 05:07:32 +0200 |
commit | 6cac3759ce118a87103ce4342e6de98215d01787 (patch) | |
tree | ea597bcaf02e80a3b09d5e4a46c8d812c211d890 /fs/f2fs | |
parent | f2fs: check truncation of mapping after lock_page (diff) | |
download | linux-6cac3759ce118a87103ce4342e6de98215d01787.tar.xz linux-6cac3759ce118a87103ce4342e6de98215d01787.zip |
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>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/node.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 6ff017245522..f14eb7b8b2c4 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -244,7 +244,7 @@ static int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) { struct f2fs_nm_info *nm_i = NM_I(sbi); - if (nm_i->nat_cnt < 2 * NM_WOUT_THRESHOLD) + if (nm_i->nat_cnt <= NM_WOUT_THRESHOLD) return 0; write_lock(&nm_i->nat_tree_lock); |