aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaeho Jeong <daehojeong@google.com>2023-11-29 11:40:33 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2023-11-29 17:25:41 -0800
commit83e64044debc641de55050c51ef8bc4596f3ae2a (patch)
tree2c88f7b54dae6e87f69684f3f6dc4f10ff8d6107
parent00efc38bb944f167f33c219c3207c830efc3e5d3 (diff)
downloadf2fs-tools-83e64044debc641de55050c51ef8bc4596f3ae2a.tar.gz
f2fs-tools: convert lost+found dir to regular dentry before adding nodes
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>
-rw-r--r--fsck/fsck.c8
-rw-r--r--fsck/fsck.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c
index 50defb1..e1848a6 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -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;
diff --git a/fsck/fsck.h b/fsck/fsck.h
index f6f15e7..d6abf18 100644
--- a/fsck/fsck.h
+++ b/fsck/fsck.h
@@ -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_ */