Skip to content

Commit 3ce937c

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: don't print error log in normal case
When allocating a new cluster, exFAT first allocates from the next cluster of the last cluster of the file. If the last cluster of the file is the last cluster of the volume, allocate from the first cluster. This is a normal case, but the following error log will be printed. It makes users confused, so this commit removes the error log. [1960905.181545] exFAT-fs (sdb1): hint_cluster is invalid (262130) Signed-off-by: Yuezhang Mo <[email protected]> Reviewed-by: Andy Wu <[email protected]> Reviewed-by: Sungjong Seo <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 8d2909e commit 3ce937c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/exfat/fatent.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,9 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
344344

345345
/* check cluster validation */
346346
if (!is_valid_cluster(sbi, hint_clu)) {
347-
exfat_err(sb, "hint_cluster is invalid (%u)",
348-
hint_clu);
347+
if (hint_clu != sbi->num_clusters)
348+
exfat_err(sb, "hint_cluster is invalid (%u), rewind to the first cluster",
349+
hint_clu);
349350
hint_clu = EXFAT_FIRST_CLUSTER;
350351
p_chain->flags = ALLOC_FAT_CHAIN;
351352
}

0 commit comments

Comments
 (0)