diff mbox series

[v2] exfat: Set the unused characters of FileName field to the value 0000h

Message ID 1591680644-8378-1-git-send-email-Hyeongseok@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2] exfat: Set the unused characters of FileName field to the value 0000h | expand

Commit Message

Hyeongseok Kim June 9, 2020, 5:30 a.m. UTC
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.

Signe-off-by: Hyeongseok.Kim <Hyeongseok@gmail.com>
---
 fs/exfat/dir.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Sungjong Seo June 9, 2020, 7:46 a.m. UTC | #1
> 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.
> 
> Signe-off-by: Hyeongseok.Kim <Hyeongseok@gmail.com>

Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>

Looks good to me. Thanks.

> ---
>  fs/exfat/dir.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index de43534..8e775bd 100644
> --- a/fs/exfat/dir.c
> +++ b/fs/exfat/dir.c
> @@ -425,10 +425,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;
> +		}
>  	}
>  }
> 
> --
> 2.7.4
Namjae Jeon June 10, 2020, 2:59 a.m. UTC | #2
> > 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.
> >
> > Signe-off-by: Hyeongseok.Kim <Hyeongseok@gmail.com>
Fixed a typo: Signe -> Signed.
> 
> Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
> 
> Looks good to me. Thanks.
Applied. Thanks!
Hyeongseok Kim June 11, 2020, 12:22 a.m. UTC | #3
On 6/10/20 11:59 AM, Namjae Jeon wrote:
>>> 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.
>>>
>>> Signe-off-by: Hyeongseok.Kim <Hyeongseok@gmail.com>
> Fixed a typo: Signe -> Signed.
Oops.
Maybe I touched Signed-off-by tag while editing commit message, and 
forgot to do checkpatch on 2nd version.
I'm sorry for bothering you and Thanks for fixing it.
>> Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
>>
>> Looks good to me. Thanks.
> Applied. Thanks!
>
>
diff mbox series

Patch

diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c
index de43534..8e775bd 100644
--- a/fs/exfat/dir.c
+++ b/fs/exfat/dir.c
@@ -425,10 +425,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;
+		}
 	}
 }