diff mbox series

[f2fs-dev] dump.f2fs: Fix dumping inlined files

Message ID 20240618004136.1336922-1-drosen@google.com (mailing list archive)
State New
Headers show
Series [f2fs-dev] dump.f2fs: Fix dumping inlined files | expand

Commit Message

Daniel Rosenberg June 18, 2024, 12:41 a.m. UTC
The code for dumping files was ignoring i_extra_isize, leading to
invalid data for some inlined files after dumping. This swaps inode
dumping to use the common inline_data_addr function.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
---
 fsck/dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: c1a97862b05d8a736ad8719939395c61bd71c982

Comments

Chao Yu June 18, 2024, 3:01 a.m. UTC | #1
On 2024/6/18 8:41, Daniel Rosenberg wrote:
> The code for dumping files was ignoring i_extra_isize, leading to
> invalid data for some inlined files after dumping. This swaps inode
> dumping to use the common inline_data_addr function.
> 
> Signed-off-by: Daniel Rosenberg <drosen@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
diff mbox series

Patch

diff --git a/fsck/dump.c b/fsck/dump.c
index 90e3e0e..8d5613e 100644
--- a/fsck/dump.c
+++ b/fsck/dump.c
@@ -479,7 +479,7 @@  static int dump_inode_blk(struct f2fs_sb_info *sbi, u32 nid,
 	if ((node_blk->i.i_inline & F2FS_INLINE_DATA)) {
 		DBG(3, "ino[0x%x] has inline data!\n", nid);
 		/* recover from inline data */
-		dev_write_dump(((unsigned char *)node_blk) + INLINE_DATA_OFFSET,
+		dev_write_dump(inline_data_addr(node_blk),
 						0, MAX_INLINE_DATA(node_blk));
 		ret = -1;
 		goto dump_xattr;