From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: qianfan <qianfanguijin@163.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-watchdog@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: linux resetting when the usb storage was removed while copying
Date: Mon, 28 Mar 2022 14:48:38 +0900 [thread overview]
Message-ID: <87pmm6hbk9.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <15b83842-60d9-78b8-54e9-3a27211caded@roeck-us.net> (Guenter Roeck's message of "Tue, 22 Mar 2022 05:31:06 -0700")
>> I had changed console to ttynull and the system doesn't reset again. kernel driver generate lots of error messages when usb storage is disconnected:
>>
>> $ dmesg | grep 'FAT read failed' | wc -l
>>
>> 608
>>
>> usb storage can work again when reconnected.
>>
>> The gpio watchdog depends on hrtimer, maybe printk in ISR delayed hrtimer that cause watchdog reset.
This limits the rate of messages. Can you try if a this patch fixes behavior?
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
[PATCH] fat: Add ratelimit to fat*_ent_bread()
fat*_ent_bread() can be the cause of too many report on I/O error
path. So use fat_msg_ratelimit() instead.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
fs/fat/fatent.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
index 978ac67..1db348f 100644
--- a/fs/fat/fatent.c 2022-03-28 14:34:04.582208819 +0900
+++ b/fs/fat/fatent.c 2022-03-28 14:39:26.884325073 +0900
@@ -94,7 +94,8 @@ static int fat12_ent_bread(struct super_
err_brelse:
brelse(bhs[0]);
err:
- fat_msg(sb, KERN_ERR, "FAT read failed (blocknr %llu)", (llu)blocknr);
+ fat_msg_ratelimit(sb, KERN_ERR, "FAT read failed (blocknr %llu)",
+ (llu)blocknr);
return -EIO;
}
@@ -107,8 +108,8 @@ static int fat_ent_bread(struct super_bl
fatent->fat_inode = MSDOS_SB(sb)->fat_inode;
fatent->bhs[0] = sb_bread(sb, blocknr);
if (!fatent->bhs[0]) {
- fat_msg(sb, KERN_ERR, "FAT read failed (blocknr %llu)",
- (llu)blocknr);
+ fat_msg_ratelimit(sb, KERN_ERR, "FAT read failed (blocknr %llu)",
+ (llu)blocknr);
return -EIO;
}
fatent->nr_bhs = 1;
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2022-03-28 5:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1cc135e3-741f-e7d6-5d0a-fef319832a4c@163.com>
2022-03-22 7:21 ` linux resetting when the usb storage was removed while copying OGAWA Hirofumi
2022-03-22 8:42 ` qianfan
2022-03-22 12:31 ` Guenter Roeck
2022-03-28 5:48 ` OGAWA Hirofumi [this message]
2022-03-29 9:08 ` qianfan
2022-03-29 10:32 ` OGAWA Hirofumi
2022-03-30 1:10 ` qianfan
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=87pmm6hbk9.fsf@mail.parknet.co.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=qianfanguijin@163.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox