mirror of https://gitee.com/openkylin/linux.git
f2fs: avoid infinite loop in f2fs_alloc_nid
If we have an error in f2fs_build_free_nids, we're able to fall into a loop to find free nids. Suggested-by: Chao Yu <chao@kernel.org> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
a7d10cf3e4
commit
f84262b086
|
@ -2350,8 +2350,9 @@ bool f2fs_alloc_nid(struct f2fs_sb_info *sbi, nid_t *nid)
|
||||||
spin_unlock(&nm_i->nid_list_lock);
|
spin_unlock(&nm_i->nid_list_lock);
|
||||||
|
|
||||||
/* Let's scan nat pages and its caches to get free nids */
|
/* Let's scan nat pages and its caches to get free nids */
|
||||||
f2fs_build_free_nids(sbi, true, false);
|
if (!f2fs_build_free_nids(sbi, true, false))
|
||||||
goto retry;
|
goto retry;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue