]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fat: fix too many log in fat_chain_add()
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Thu, 24 Jul 2025 07:42:10 +0000 (16:42 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 2 Aug 2025 19:01:40 +0000 (12:01 -0700)
This log was excessive for a serial console.  So use the ratelimited
version instead.

Link: https://lkml.kernel.org/r/87qzy611d9.fsf@mail.parknet.co.jp
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Reported-by: syzbot+fa7ef54f66c189c04b73@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=fa7ef54f66c189c04b73
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/fat/misc.c

index c7a2d27120bab7bd4c95552000b5f4f25426fe05..950da09f096143b07efcca3bc1fd7ada93e50d69 100644 (file)
@@ -158,9 +158,9 @@ int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster)
                        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);