Skip to content

Commit 4ba6ccd

Browse files
hyeongseok-kim901namjaejeon
authored andcommitted
exfat: Set the unused characters of FileName field to the value 0000h
Some fsck tool complain that padding part of the FileName field is not set to the value 0000h. So let's maintain filesystem cleaner, as exfat's spec. recommendation. Signed-off-by: Hyeongseok.Kim <[email protected]> Reviewed-by: Sungjong Seo <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 9ebcfad commit 4ba6ccd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

fs/exfat/dir.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,12 @@ static void exfat_init_name_entry(struct exfat_dentry *ep,
425425
ep->dentry.name.flags = 0x0;
426426

427427
for (i = 0; i < EXFAT_FILE_NAME_LEN; i++) {
428-
ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
429-
if (*uniname == 0x0)
430-
break;
431-
uniname++;
428+
if (*uniname != 0x0) {
429+
ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
430+
uniname++;
431+
} else {
432+
ep->dentry.name.unicode_0_14[i] = 0x0;
433+
}
432434
}
433435
}
434436

0 commit comments

Comments
 (0)