linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs-tools: convert lost+found dir to regular dentry before adding nodes
@ 2023-11-29 19:40 Daeho Jeong
  0 siblings, 0 replies; only message in thread
From: Daeho Jeong @ 2023-11-29 19:40 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Daeho Jeong

From: Daeho Jeong <daehojeong@google.com>

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>
---
 fsck/fsck.c | 8 ++++++++
 fsck/fsck.h | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index 55eddca..f40b4cd 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_ */
-- 
2.43.0.rc2.451.g8631bc7472-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-29 19:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-29 19:40 [f2fs-dev] [PATCH] f2fs-tools: convert lost+found dir to regular dentry before adding nodes Daeho Jeong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).