[PATCH] fat: Fix too many log in fat_chain_add()

OGAWA Hirofumi posted 1 patch 2 months, 1 week ago
fs/fat/misc.c |    6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] fat: Fix too many log in fat_chain_add()
Posted by OGAWA Hirofumi 2 months, 1 week ago

This log was too many for serial console. So this patch uses ratelimit
version instead.

Reported-by: syzbot+fa7ef54f66c189c04b73@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=fa7ef54f66c189c04b73
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
 fs/fat/misc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/fat/misc.c b/fs/fat/misc.c
index c7a2d27..950da09 100644
--- a/fs/fat/misc.c	2025-07-24 16:14:10.499172171 +0900
+++ b/fs/fat/misc.c	2025-07-24 16:16:10.252088550 +0900
@@ -158,9 +158,9 @@ int fat_chain_add(struct inode *inode, i
 			mark_inode_dirty(inode);
 	}
 	if (new_fclus != (inode->i_blocks >> (sbi->cluster_bits - 9))) {
-		fat_fs_error(sb, "clusters badly computed (%d != %llu)",
-			     new_fclus,
-			     (llu)(inode->i_blocks >> (sbi->cluster_bits - 9)));
+		fat_fs_error_ratelimit(
+			sb, "clusters badly computed (%d != %llu)", new_fclus,
+			(llu)(inode->i_blocks >> (sbi->cluster_bits - 9)));
 		fat_cache_inval_inode(inode);
 	}
 	inode->i_blocks += nr_cluster << (sbi->cluster_bits - 9);
_
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>