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 <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Yuezhang Mo 2023-02-28 15:30:06 +09:00 committed by Namjae Jeon
parent cd17de5006
commit 7a55bf46a5

View File

@ -359,8 +359,9 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
/* check cluster validation */ /* check cluster validation */
if (!is_valid_cluster(sbi, hint_clu)) { if (!is_valid_cluster(sbi, hint_clu)) {
exfat_err(sb, "hint_cluster is invalid (%u)", if (hint_clu != sbi->num_clusters)
hint_clu); exfat_err(sb, "hint_cluster is invalid (%u), rewind to the first cluster",
hint_clu);
hint_clu = EXFAT_FIRST_CLUSTER; hint_clu = EXFAT_FIRST_CLUSTER;
p_chain->flags = ALLOC_FAT_CHAIN; p_chain->flags = ALLOC_FAT_CHAIN;
} }