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

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