Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e350f2d4 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "f2fs: fix indefinite loop scanning for free nid"

parents 621f4c90 03b72b15
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2371,6 +2371,9 @@ static int __f2fs_build_free_nids(struct f2fs_sb_info *sbi,
	if (unlikely(nid >= nm_i->max_nid))
		nid = 0;

	if (unlikely(nid % NAT_ENTRY_PER_BLOCK))
		nid = NAT_BLOCK_OFFSET(nid) * NAT_ENTRY_PER_BLOCK;

	/* Enough entries */
	if (nm_i->nid_cnt[FREE_NID] >= NAT_ENTRY_PER_BLOCK)
		return 0;