mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
f2fs: keep scanning until enough free nids are acquired
In current version, after scan_free_nid_bits, the scan is over if nid_cnt[FREE_NID] != 0. In most cases, there are still free nids in the free list during the scan, and scan_free_nid_bits usually can't increase nid_cnt[FREE_NID]. It causes that __build_free_nids is called many times without solving the shortage of the free nids. This patch fixes that. Signed-off-by: Fan li <fanofcode.li@samsung.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
a5fd505092
commit
74986213ad
@ -2015,7 +2015,7 @@ static void __build_free_nids(struct f2fs_sb_info *sbi, bool sync, bool mount)
|
||||
/* try to find free nids in free_nid_bitmap */
|
||||
scan_free_nid_bits(sbi);
|
||||
|
||||
if (nm_i->nid_cnt[FREE_NID])
|
||||
if (nm_i->nid_cnt[FREE_NID] >= NAT_ENTRY_PER_BLOCK)
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user