Skip to content

Commit

Permalink
f2fs-tools: convert lost+found dir to regular dentry before adding nodes
Browse files Browse the repository at this point in the history
fsck doesn't support adding inodes to inline dentries. So, need to
convert inline lost+found dentry before adding missing inodes.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Daeho Jeong authored and Jaegeuk Kim committed Nov 30, 2023
1 parent 00efc38 commit 83e6404
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fsck/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,14 @@ static struct f2fs_node *fsck_get_lpf(struct f2fs_sb_info *sbi)
/* FIXME: give up? */
goto out;
}

/* Must convert inline dentry before adding inodes */
err = convert_inline_dentry(sbi, node, ni.blk_addr);
if (err) {
MSG(0, "Convert inline dentry for ino=%x failed.\n",
lpf_ino);
goto out;
}
} else { /* not found, create it */
struct dentry de;

Expand Down
4 changes: 4 additions & 0 deletions fsck/fsck.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,8 @@ void *read_all_xattrs(struct f2fs_sb_info *, struct f2fs_node *, bool);
void write_all_xattrs(struct f2fs_sb_info *sbi,
struct f2fs_node *inode, __u32 hsize, void *txattr_addr);

/* dir.c */
int convert_inline_dentry(struct f2fs_sb_info *sbi, struct f2fs_node *node,
block_t p_blkaddr);

#endif /* _FSCK_H_ */

0 comments on commit 83e6404

Please sign in to comment.