Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3dd3310 authored by Ankit Jain's avatar Ankit Jain
Browse files

fs: fat: ratelimit the IO errors



In case of card is removed by low-level driver on removing
the card physically, IO errors are expected for already
queued IO requests.

Ratelimit those errors with the default ratelimit to avoid
watchdog bark issue in some cases.

Change-Id: If91f53a8a86749fc18783c58ce8eb577347810c5
Signed-off-by: default avatarAnkit Jain <jankit@codeaurora.org>
parent 1ee53587
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ static int fat12_ent_bread(struct super_block *sb, struct fat_entry *fatent,
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;
}

@@ -105,7 +106,8 @@ static int fat_ent_bread(struct super_block *sb, struct fat_entry *fatent,
	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)",
		fat_msg_ratelimit(sb, KERN_ERR,
			"FAT read failed (blocknr %llu)",
			(llu)blocknr);
		return -EIO;
	}
+4 −6
Original line number Diff line number Diff line
@@ -625,10 +625,8 @@ static void fat_free_eofblocks(struct inode *inode)
		 */
		err = __fat_write_inode(inode, inode_needs_sync(inode));
		if (err) {
			fat_msg(inode->i_sb, KERN_WARNING, "Failed to "
					"update on disk inode for unused "
					"fallocated blocks, inode could be "
					"corrupted. Please run fsck");
			fat_msg_ratelimit(inode->i_sb, KERN_WARNING,
				"Failed to update on disk inode for unused fallocated blocks, inode could be corrupted. Please run fsck");
		}

	}
@@ -672,7 +670,7 @@ static void fat_set_state(struct super_block *sb,

	bh = sb_bread(sb, 0);
	if (bh == NULL) {
		fat_msg(sb, KERN_ERR, "unable to read boot sector "
		fat_msg_ratelimit(sb, KERN_ERR, "unable to read boot sector "
			"to mark fs as dirty");
		return;
	}
@@ -851,7 +849,7 @@ static int __fat_write_inode(struct inode *inode, int wait)
	fat_get_blknr_offset(sbi, i_pos, &blocknr, &offset);
	bh = sb_bread(sb, blocknr);
	if (!bh) {
		fat_msg(sb, KERN_ERR, "unable to read inode block "
		fat_msg_ratelimit(sb, KERN_ERR, "unable to read inode block "
		       "for updating (i_pos %lld)", i_pos);
		return -EIO;
	}
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ int fat_clusters_flush(struct super_block *sb)

	bh = sb_bread(sb, sbi->fsinfo_sector);
	if (bh == NULL) {
		fat_msg(sb, KERN_ERR, "bread failed in fat_clusters_flush");
		fat_msg_ratelimit(sb, KERN_ERR, "bread failed in %s", __func__);
		return -EIO;
	}