diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 5452a6e340daa0f4269317d9b75fac51a02dbf12..e29d5f6735ae9143d70d9d7c75ba1ebee2b011c5 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2083,6 +2083,9 @@ static bool add_free_nid(struct f2fs_sb_info *sbi, if (unlikely(nid == 0)) return false; + if (unlikely(f2fs_check_nid_range(sbi, nid))) + return false; + i = f2fs_kmem_cache_alloc(free_nid_slab, GFP_NOFS); i->nid = nid; i->state = FREE_NID;