diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-18 21:43:59 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-20 09:10:08 -0400 |
commit | 40bb0058c871c6ddcd4aff9fe2f5224e59aba47b (patch) | |
tree | e77b844ff325c799afc0760bc0d4d23b788ecb10 /fs/f2fs/node.c | |
parent | 3cb5ad152b54430f3e5f338c15f8cd434e7160c8 (diff) |
f2fs: avoid to drop nat entries due to the negative nr_shrink
The try_to_free_nats should not receive the negative nr_shrink.
Otherwise, it can drop all the nat entries by the while loop.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.c')
-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 9a6d8bbf0bd7..d27e65a1fb0b 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c | |||
@@ -208,7 +208,7 @@ int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) | |||
208 | { | 208 | { |
209 | struct f2fs_nm_info *nm_i = NM_I(sbi); | 209 | struct f2fs_nm_info *nm_i = NM_I(sbi); |
210 | 210 | ||
211 | if (nm_i->nat_cnt <= NM_WOUT_THRESHOLD) | 211 | if (nm_i->nat_cnt <= NM_WOUT_THRESHOLD || nr_shrink <= 0) |
212 | return 0; | 212 | return 0; |
213 | 213 | ||
214 | write_lock(&nm_i->nat_tree_lock); | 214 | write_lock(&nm_i->nat_tree_lock); |