Skip to contentSkip to conversation

fsck.f2fs: fix incorrect boundary of IS_VALID_NID()

PATCH New Chao Yu 1 participant 1 message Jan 9, 2019

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 fsck.f2fs: fix incorrect boundary of IS_VALID_NID()

nid should never equal to max_nid, fix it.

---
 fsck/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/f2fs.h +1 -1
index 0d0d5e2cc399..82ecb05ddc5e 100644
@@ -369,7 +369,7 @@ static inline block_t sum_blk_addr(struct f2fs_sb_info *sbi, int base, int type)
 
 static inline bool IS_VALID_NID(struct f2fs_sb_info *sbi, u32 nid)
 {
-	return (nid <= (NAT_ENTRY_PER_BLOCK *
+	return (nid < (NAT_ENTRY_PER_BLOCK *
 			le32_to_cpu(F2FS_RAW_SUPER(sbi)->segment_count_nat)
 			<< (sbi->log_blocks_per_seg - 1)));
 }
Signature · 1 line
2.18.0.rc1