All of lore.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Li Chen <me@linux.beauty>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] fs: fat: Prevent fsfuzzer from dominating the console
Date: Fri, 20 Jun 2025 12:15:59 +0900	[thread overview]
Message-ID: <87a563w1ao.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <20250620020231.9292-1-me@linux.beauty>

Li Chen <me@linux.beauty> writes:

> From: Li Chen <chenl311@chinatelecom.cn>
>
> fsfuzzer may make many invalid access for FAT-fs and generate many kmsg
> like "FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)".
>
> For platforms & os that enables hardware serial device whose speed are
> slow, this may cause softlockup easily.
>
> So let's ratelimit the error log.
>
> The log as below:
> [11916.242560] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.254485] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.266388] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.278287] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.290180] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.302068] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.313962] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.325848] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.337732] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.349619] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.361505] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.373391] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.385272] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.397144] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.409025] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.420909] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.432791] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.444674] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.456558] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.468446] FAT-fs (loop2): error, invalid access to FAT (entry 0x00000ccb)
> [11916.480352] watchdog: BUG: soft lockup - CPU#58 stuck for 26s! [cat:2446035]
> [11916.480357] Modules linked in: ...
> [11916.480503] CPU: 58 PID: 2446035 Comm: cat Kdump: loaded Tainted: ...
> [11916.480508] Hardware name: vclusters VSFT5000 B/VSFT5000 B, BIOS ...
> [11916.480510] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [11916.480513] pc : console_emit_next_record+0x1b4/0x288
> [11916.480524] lr : console_emit_next_record+0x1ac/0x288
> [11916.480525] sp : ffff80009bcdae90
> [11916.480527] x29: ffff80009bcdaec0 x28: ffff800082513810 x27: 0000000000000001
> [11916.480530] x26: 0000000000000001 x25: ffff800081f66000 x24: 0000000000000000
> [11916.480533] x23: 0000000000000000 x22: ffff80009bcdaf8f x21: 0000000000000001
> [11916.480535] x20: 0000000000000000 x19: ffff800082513810 x18: ffffffffffffffff
> [11916.480538] x17: 0000000000000002 x16: 0000000000000001 x15: ffff80009bcdab30
> [11916.480541] x14: 0000000000000000 x13: 205d353330363434 x12: 32545b5d36343438
> [11916.480543] x11: 652820544146206f x10: 7420737365636361 x9 : ffff800080159a6c
> [11916.480546] x8 : 69202c726f727265 x7 : 545b5d3634343836 x6 : 342e36313931315b
> [11916.480549] x5 : ffff800082513a01 x4 : ffff80009bcdad31 x3 : 0000000000000000
> [11916.480551] x2 : 00000000ffffffff x1 : 0000000001b9b000 x0 : ffff8000836cef00
> [11916.480554] Call trace:
> [11916.480557]  console_emit_next_record+0x1b4/0x288
> [11916.480560]  console_flush_all+0xcc/0x190
> [11916.480563]  console_unlock+0x78/0x138
> [11916.480565]  vprintk_emit+0x1c4/0x210
> [11916.480568]  vprintk_default+0x40/0x58
> [11916.480570]  vprintk+0x84/0xc8
> [11916.480572]  _printk+0x68/0xa0
> [11916.480578]  _fat_msg+0x6c/0xa0 [fat]
> [11916.480593]  __fat_fs_error+0xf8/0x118 [fat]
> [11916.480601]  fat_ent_read+0x164/0x238 [fat]
> [11916.480609]  fat_get_cluster+0x180/0x2c8 [fat]
> [11916.480617]  fat_get_mapped_cluster+0xb8/0x170 [fat]
>
> Signed-off-by: Li Chen <chenl311@chinatelecom.cn>

Looks good.

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Thanks.

> ---
> Changelog:
> v2: use fat_fs_error_ratelimit instead as suggested by OGAWA Hirofumi
>
>  fs/fat/fatent.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
> index 1db348f8f887a..a7061c2ad8e4d 100644
> --- a/fs/fat/fatent.c
> +++ b/fs/fat/fatent.c
> @@ -356,7 +356,7 @@ int fat_ent_read(struct inode *inode, struct fat_entry *fatent, int entry)
>  
>  	if (!fat_valid_entry(sbi, entry)) {
>  		fatent_brelse(fatent);
> -		fat_fs_error(sb, "invalid access to FAT (entry 0x%08x)", entry);
> +		fat_fs_error_ratelimit(sb, "invalid access to FAT (entry 0x%08x)", entry);
>  		return -EIO;
>  	}

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

      reply	other threads:[~2025-06-20  3:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20  2:02 [PATCH V2] fs: fat: Prevent fsfuzzer from dominating the console Li Chen
2025-06-20  3:15 ` OGAWA Hirofumi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a563w1ao.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@linux.beauty \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.