aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-03-19 10:43:59 +0900
committerAndreas Blaesius <skate4life@gmx.de>2016-06-05 21:21:23 +0200
commit5bb62494371bf69afc6653f37c03e328e2efac1c (patch)
tree1ed5e17a56d14ab2453c4c729c4375c29ebedddb /fs
parentb386f8272d41ed4e3842dfe0c5ea9ad2a938dd80 (diff)
downloadkernel_samsung_espresso10-5bb62494371bf69afc6653f37c03e328e2efac1c.zip
kernel_samsung_espresso10-5bb62494371bf69afc6653f37c03e328e2efac1c.tar.gz
kernel_samsung_espresso10-5bb62494371bf69afc6653f37c03e328e2efac1c.tar.bz2
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')
-rw-r--r--fs/f2fs/node.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 2bcbcf8..ecfedf8 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)
{
struct f2fs_nm_info *nm_i = NM_I(sbi);
- if (nm_i->nat_cnt <= NM_WOUT_THRESHOLD)
+ if (nm_i->nat_cnt <= NM_WOUT_THRESHOLD || nr_shrink <= 0)
return 0;
write_lock(&nm_i->nat_tree_lock);