Re: linux resetting when the usb storage was removed while copying

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> 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@xxxxxxxxxxxxxxxxxx>


[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@xxxxxxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxx>



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux