summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHyeongseok.Kim <Hyeongseok@gmail.com>2020-06-09 14:30:44 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-09 09:39:25 +0200
commitb4ce7251416b50f675452db04644b3676a1d3daf (patch)
tree3fa0eb88585ea9ffdbf898abcd0e3f594f9c3a48 /fs
parentfb6c7905238010236cf0750b209ce9162222eb97 (diff)
exfat: Set the unused characters of FileName field to the value 0000h
[ Upstream commit 4ba6ccd695f5ed3ae851e59b443b757bbe4557fe ] 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 <Hyeongseok@gmail.com> Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/exfat/dir.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c
index 4b91afb0f051..349ca0c282c2 100644
--- a/fs/exfat/dir.c
+++ b/fs/exfat/dir.c
@@ -430,10 +430,12 @@ static void exfat_init_name_entry(struct exfat_dentry *ep,
ep->dentry.name.flags = 0x0;
for (i = 0; i < EXFAT_FILE_NAME_LEN; i++) {
- ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
- if (*uniname == 0x0)
- break;
- uniname++;
+ if (*uniname != 0x0) {
+ ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
+ uniname++;
+ } else {
+ ep->dentry.name.unicode_0_14[i] = 0x0;
+ }
}
}