diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index e84e8807c6514fa92a7912ea6986a5e767daacea..bcf893c3d9036d0eb743ff8c34bae2eda23e9582 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -121,6 +121,13 @@ static struct f2fs_dir_entry *find_in_block(struct page *dentry_page, *max_slots = max_len; max_len = 0; } + + /* + * For the most part, it should be a bug when name_len is zero. + * We stop here for figuring out where the bugs are occurred. + */ + f2fs_bug_on(!de->name_len); + bit_pos += GET_DENTRY_SLOTS(le16_to_cpu(de->name_len)); }