Re: [PATCH] exfat: clear filename field before setting initial name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/9/20 11:36 AM, Namjae Jeon wrote:
Hi Hyeongseok,

Some fsck tool complain that padding part of the FileName Field is not set to the value 0000h. So
let's follow the filesystem spec.

Signed-off-by: Hyeongseok.Kim <Hyeongseok@xxxxxxxxx>
---
  fs/exfat/dir.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index de43534..6c9810b 100644
--- a/fs/exfat/dir.c
+++ b/fs/exfat/dir.c
@@ -424,6 +424,9 @@ static void exfat_init_name_entry(struct exfat_dentry *ep,
  	exfat_set_entry_type(ep, TYPE_EXTEND);
  	ep->dentry.name.flags = 0x0;

+	memset(ep->dentry.name.unicode_0_14, 0,
+		sizeof(ep->dentry.name.unicode_0_14));
+
  	for (i = 0; i < EXFAT_FILE_NAME_LEN; i++) {
  		ep->dentry.name.unicode_0_14[i] = cpu_to_le16(*uniname);
  		if (*uniname == 0x0)
Wouldn't it be better to fill the rest with 0x0000 in this loop?
OK, I'll change like that.
--
2.7.4

.





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux