diff mbox series

[f2fs-dev,06/13] f2fs: fix address info has been truncated

Message ID 99802996a3f4a0c2d89c79ec17be94e9c62ff8b6.1725334811.git.bo.wu@vivo.com (mailing list archive)
State Superseded
Headers show
Series f2fs: introduce inline tail | expand

Commit Message

Wu Bo Sept. 3, 2024, 8:54 a.m. UTC
If there is no data inline, the address table should not be truncate,
in case there may be reserved address info.

Signed-off-by: Wu Bo <bo.wu@vivo.com>
---
 fs/f2fs/inline.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 30b18053e784..a542956d618a 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -224,7 +224,8 @@  int f2fs_clear_inline_tail(struct inode *inode, bool force)
 	if (IS_ERR(ipage))
 		return PTR_ERR(ipage);
 
-	f2fs_truncate_inline_inode(inode, ipage, 0);
+	if (f2fs_exist_data(inode))
+		f2fs_truncate_inline_inode(inode, ipage, 0);
 	clear_page_private_inline(ipage);
 
 	if (force || end_index >= COMPACT_ADDRS_PER_INODE)