From 7a55bf46a5e4d10662cb75ca54b88b59e5621dc9 Mon Sep 17 00:00:00 2001 From: Yuezhang Mo Date: Tue, 28 Feb 2023 15:30:06 +0900 Subject: [PATCH] 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 Reviewed-by: Andy Wu Signed-off-by: Namjae Jeon --- fatent.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fatent.c b/fatent.c index e22a77b7d54c..f46bbce781bb 100644 --- a/fatent.c +++ b/fatent.c @@ -359,8 +359,9 @@ int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc, /* check cluster validation */ if (!is_valid_cluster(sbi, hint_clu)) { - exfat_err(sb, "hint_cluster is invalid (%u)", - hint_clu); + if (hint_clu != sbi->num_clusters) + exfat_err(sb, "hint_cluster is invalid (%u), rewind to the first cluster", + hint_clu); hint_clu = EXFAT_FIRST_CLUSTER; p_chain->flags = ALLOC_FAT_CHAIN; }