You are not logged in.
Mounting an exfat fs on 6.17.9 gives:
mount: /run/media/AWD1T: can't read superblock on /dev/sda1.
dmesg(1) may have more information after failed mount system call.Related dmesg message:
[ +3.177475] sd 6:0:0:0: [sda] 1953458176 512-byte logical blocks: (1.00 TB/931 GiB)
[ +0.000560] sd 6:0:0:0: [sda] Write Protect is off
[ +0.000004] sd 6:0:0:0: [sda] Mode Sense: 47 00 10 08
[ +0.000547] sd 6:0:0:0: [sda] No Caching mode page found
[ +0.000002] sd 6:0:0:0: [sda] Assuming drive cache: write through
[ +0.041258] sda: sda1 sda2
[ +0.000094] sd 6:0:0:0: [sda] Attached SCSI disk
[ +4.240762] exFAT-fs (sda1): failed to load alloc-bitmap
[ +0.000006] exFAT-fs (sda1): failed to recognize exfat typeEverything works well on 6.16.8
Offline
fsck.exfat gives:
failed to init locale/codeset
exfatprogs version : 1.3.0
/dev/disk/by-label/AWD1T: clean. directories 259, files 3744Offline
Seems like there's some changes in the bitmap code, as per git logs.
Particularly here it's failing to load, suspect:
commit 9fd688678dd86e3be32a35e3b2c5cc3ef0c4e257
Author: Namjae Jeon <linkinjeon@kernel.org>
Date: Sat Sep 6 08:13:04 2025 +0900
exfat: optimize allocation bitmap loading time
Loading the allocation bitmap is very slow if user set the small cluster
size on large partition.
For optimizing it, This patch uses sb_breadahead() read the allocation
bitmap. It will improve the mount time.
The following is the result of about 4TB partition(2KB cluster size)
on my target.
without patch:
real 0m41.746s
user 0m0.011s
sys 0m0.000s
with patch:
real 0m2.525s
user 0m0.008s
sys 0m0.008s
Reviewed-by: Sungjong Seo <sj1557.seo@...>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@...>
Signed-off-by: Namjae Jeon <linkinjeon@...>
Last edited by ReDress (2025-12-07 09:51:27)
Offline
failed to init locale/codeset
Not saying it's related, but just to be sure:
localectl
locale
locale -aOffline
Also did you already try to run 6.17.9 with the patch reverted? Also there is 6.17.10 in the meantime (which we didn't package for Arch Linux). If you want I can also prepare you a build with both ![]()
Offline
I tried 6.18.0 with that patch reverted, doesn't work
Last edited by aleck099 (2025-12-08 16:38:53)
Offline
Confirmed. The bad commit is
commit 79c1587b6cda74deb0c86fc7ba194b92958c793c
Author: Namjae Jeon <linkinjeon@kernel.org>
Date: Sat Aug 30 14:44:35 2025 +0900
exfat: validate cluster allocation bits of the allocation bitmap
syzbot created an exfat image with cluster bits not set for the allocation
bitmap. exfat-fs reads and uses the allocation bitmap without checking
this. The problem is that if the start cluster of the allocation bitmap
is 6, cluster 6 can be allocated when creating a directory with mkdir.
exfat zeros out this cluster in exfat_mkdir, which can delete existing
entries. This can reallocate the allocated entries. In addition,
the allocation bitmap is also zeroed out, so cluster 6 can be reallocated.
This patch adds exfat_test_bitmap_range to validate that clusters used for
the allocation bitmap are correctly marked as in-use.
Reported-by: syzbot+a725ab460fc1def9896f@syzkaller.appspotmail.com
Tested-by: syzbot+a725ab460fc1def9896f@syzkaller.appspotmail.com
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>A new function is added:
/*
* Allocation Bitmap Management Functions
*/
static bool exfat_test_bitmap_range(struct super_block *sb, unsigned int clu,
unsigned int count)
{
struct exfat_sb_info *sbi = EXFAT_SB(sb);
unsigned int start = clu;
unsigned int end = clu + count;
unsigned int ent_idx, i, b;
unsigned int bit_offset, bits_to_check;
__le_long *bitmap_le;
unsigned long mask, word;
if (!is_valid_cluster(sbi, start) || !is_valid_cluster(sbi, end - 1))
return false;
while (start < end) {
ent_idx = CLUSTER_TO_BITMAP_ENT(start);
i = BITMAP_OFFSET_SECTOR_INDEX(sb, ent_idx);
b = BITMAP_OFFSET_BIT_IN_SECTOR(sb, ent_idx);
printk("i = %u, b = %u\n", i, b);
bitmap_le = (__le_long *)sbi->vol_amap[i]->b_data;
/* Calculate how many bits we can check in the current word */
bit_offset = b % BITS_PER_LONG;
printk("bit_offset = %u\n", bit_offset);
bits_to_check = min(end - start,
(unsigned int)(BITS_PER_LONG - bit_offset));
printk("bits_to_check = %u\n", bits_to_check);
/* Create a bitmask for the range of bits to check */
if (bits_to_check >= BITS_PER_LONG)
mask = ~0UL;
else
mask = ((1UL << bits_to_check) - 1) << bit_offset;
word = lel_to_cpu(bitmap_le[b / BITS_PER_LONG]);
printk("word = %016lx, mask = %016lx\n", word, mask);
/* Check if all bits in the mask are set */
if ((word & mask) != mask)
return false;
start += bits_to_check;
}
return true;
}I inserted several printk to show the details when mounting, and it outputs:
i = 0, b = 96
bit_offset = 32
bits_to_check = 20
word = ffc7ffffffffffff, mask = 000fffff00000000Offline
If the issue is still present in the latest mainline release candidate then please consider reporting the issue upstream.
Offline
Fixed by fsck.exfat after upgrading exfatprogs to 1.3.1
Offline
Please mark the thread as solved by prefixing the first post with [SOLVED]
Offline