Blame SOURCES/0039-exfat-Set-the-unused-characters-of-FileName-field-to.patch

Kmods SIG 9e3ffb
From 4ba6ccd695f5ed3ae851e59b443b757bbe4557fe Mon Sep 17 00:00:00 2001
Kmods SIG 9e3ffb
From: "Hyeongseok.Kim" <Hyeongseok@gmail.com>
Kmods SIG 9e3ffb
Date: Tue, 9 Jun 2020 14:30:44 +0900
Kmods SIG 9e3ffb
Subject: [Backport 4ba6ccd695f5] exfat: Set the unused characters of FileName
Kmods SIG 9e3ffb
 field to the value 0000h
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
Some fsck tool complain that padding part of the FileName field
Kmods SIG 9e3ffb
is not set to the value 0000h. So let's maintain filesystem cleaner,
Kmods SIG 9e3ffb
as exfat's spec. recommendation.
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
Signed-off-by: Hyeongseok.Kim <Hyeongseok@gmail.com>
Kmods SIG 9e3ffb
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Kmods SIG 9e3ffb
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Kmods SIG 9e3ffb
---
Kmods SIG 9e3ffb
 src/dir.c | 10 ++++++----
Kmods SIG 9e3ffb
 1 file changed, 6 insertions(+), 4 deletions(-)
Kmods SIG 9e3ffb
Kmods SIG 9e3ffb
diff --git a/src/dir.c b/src/dir.c
Kmods SIG 9e3ffb
index de43534aa2997aa87994a9447f95578de9931258..8e775bd5d523046530b9c82a58264a358bf857e3 100644
Kmods SIG 9e3ffb
--- a/src/dir.c
Kmods SIG 9e3ffb
+++ b/src/dir.c
Kmods SIG 9e3ffb
@@ -425,10 +425,12 @@ static void exfat_init_name_entry(struct exfat_dentry *ep,
Kmods SIG 9e3ffb
 	ep->dentry.name.flags = 0x0;
Kmods SIG 9e3ffb
 
Kmods SIG 9e3ffb
 	for (i = 0; i < EXFAT_FILE_NAME_LEN; i++) {
Kmods SIG 9e3ffb
-		ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
Kmods SIG 9e3ffb
-		if (*uniname == 0x0)
Kmods SIG 9e3ffb
-			break;
Kmods SIG 9e3ffb
-		uniname++;
Kmods SIG 9e3ffb
+		if (*uniname != 0x0) {
Kmods SIG 9e3ffb
+			ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
Kmods SIG 9e3ffb
+			uniname++;
Kmods SIG 9e3ffb
+		} else {
Kmods SIG 9e3ffb
+			ep->dentry.name.unicode_0_14[i] = 0x0;
Kmods SIG 9e3ffb
+		}
Kmods SIG 9e3ffb
 	}
Kmods SIG 9e3ffb
 }
Kmods SIG 9e3ffb
 
Kmods SIG 9e3ffb
-- 
Kmods SIG 9e3ffb
2.31.1
Kmods SIG 9e3ffb