From: Jaegeuk Kim Date: Wed, 19 Mar 2014 01:43:59 +0000 (+0900) Subject: f2fs: avoid to drop nat entries due to the negative nr_shrink X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40bb0058c871c6ddcd4aff9fe2f5224e59aba47b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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) { 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);