Skip to content

Commit 6dfba10

Browse files
Chi Zhilingnamjaejeon
authored andcommitted
exfat: limit log print for IO error
For exFAT filesystems with 4MB read_ahead_size, removing the storage device when the read operation is in progress, which cause the last read syscall spent 150s [1]. The main reason is that exFAT generates excessive log messages [2]. After applying this patch, approximately 300,000 lines of log messages were suppressed, and the delay of the last read() syscall was reduced to about 4 seconds. [1]: write(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 131072) = 131072 <0.000120> read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 131072) = 131072 <0.000032> write(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 131072) = 131072 <0.000119> read(4, 0x7fccf28ae000, 131072) = -1 EIO (Input/output error) <150.186215> [2]: [ 333.696603] exFAT-fs (vdb): error, failed to access to FAT (entry 0x0000d780, err:-5) [ 333.697378] exFAT-fs (vdb): error, failed to access to FAT (entry 0x0000d780, err:-5) [ 333.698156] exFAT-fs (vdb): error, failed to access to FAT (entry 0x0000d780, err:-5) Signed-off-by: Chi Zhiling <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 30d4efb commit 6dfba10

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fs/exfat/fatent.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,35 +89,36 @@ int exfat_ent_get(struct super_block *sb, unsigned int loc,
8989
int err;
9090

9191
if (!is_valid_cluster(sbi, loc)) {
92-
exfat_fs_error(sb, "invalid access to FAT (entry 0x%08x)",
92+
exfat_fs_error_ratelimit(sb,
93+
"invalid access to FAT (entry 0x%08x)",
9394
loc);
9495
return -EIO;
9596
}
9697

9798
err = __exfat_ent_get(sb, loc, content);
9899
if (err) {
99-
exfat_fs_error(sb,
100+
exfat_fs_error_ratelimit(sb,
100101
"failed to access to FAT (entry 0x%08x, err:%d)",
101102
loc, err);
102103
return err;
103104
}
104105

105106
if (*content == EXFAT_FREE_CLUSTER) {
106-
exfat_fs_error(sb,
107+
exfat_fs_error_ratelimit(sb,
107108
"invalid access to FAT free cluster (entry 0x%08x)",
108109
loc);
109110
return -EIO;
110111
}
111112

112113
if (*content == EXFAT_BAD_CLUSTER) {
113-
exfat_fs_error(sb,
114+
exfat_fs_error_ratelimit(sb,
114115
"invalid access to FAT bad cluster (entry 0x%08x)",
115116
loc);
116117
return -EIO;
117118
}
118119

119120
if (*content != EXFAT_EOF_CLUSTER && !is_valid_cluster(sbi, *content)) {
120-
exfat_fs_error(sb,
121+
exfat_fs_error_ratelimit(sb,
121122
"invalid access to FAT (entry 0x%08x) bogus content (0x%08x)",
122123
loc, *content);
123124
return -EIO;

0 commit comments

Comments
 (0)