public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: don't call block truncation for aliased file
@ 2025-01-07  2:32 Jaegeuk Kim
  2025-01-07 14:54 ` [f2fs-dev] " Chao Yu
  2025-01-07 19:09 ` [PATCH v2] " Jaegeuk Kim
  0 siblings, 2 replies; 5+ messages in thread
From: Jaegeuk Kim @ 2025-01-07  2:32 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel; +Cc: Jaegeuk Kim

This patch should avoid the below warning which does not corrupt the metadata
tho.

[   51.508120][  T253] F2FS-fs (dm-59): access invalid blkaddr:36
[   51.508156][  T253]  __f2fs_is_valid_blkaddr+0x330/0x384
[   51.508162][  T253]  f2fs_is_valid_blkaddr_raw+0x10/0x24
[   51.508163][  T253]  f2fs_truncate_data_blocks_range+0x1ec/0x438
[   51.508177][  T253]  f2fs_remove_inode_page+0x8c/0x148
[   51.508194][  T253]  f2fs_evict_inode+0x230/0x76c

Fixes: 128d333f0dff ("f2fs: introduce device aliasing file")
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/node.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index c04ee1a7ce57..06313e1eb884 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1274,6 +1274,12 @@ int f2fs_remove_inode_page(struct inode *inode)
 		return err;
 	}
 
+	/* The aliase file must be truncated successfully. */
+	if (unlikely(IS_DEVICE_ALIASING(inode))) {
+		f2fs_put_dnode(&dn);
+		return 0;
+	}
+
 	/* remove potential inline_data blocks */
 	if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
 				S_ISLNK(inode->i_mode))
-- 
2.47.1.613.gc27f4b7a9f-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-08  6:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-07  2:32 [PATCH] f2fs: don't call block truncation for aliased file Jaegeuk Kim
2025-01-07 14:54 ` [f2fs-dev] " Chao Yu
2025-01-07 18:16   ` Daeho Jeong
2025-01-07 19:09 ` [PATCH v2] " Jaegeuk Kim
2025-01-08  6:27   ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox