Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp661707ybt; Wed, 8 Jul 2020 08:42:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxTXl1q295Ws6xzwmfywDsvhfEPQR9rqpv/2bdTHPfMJVxt8dyeY3X7JPwMMEFs57LKoLb X-Received: by 2002:a17:906:c7c3:: with SMTP id dc3mr38755279ejb.376.1594222938446; Wed, 08 Jul 2020 08:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594222938; cv=none; d=google.com; s=arc-20160816; b=K9/jnn9CoCkqIil5pNK4UBlx3fHaU8w5kjQvxpbm6wKu1WSSeq7PDKcO+PPV/DQ88P /h7yImOpqinaFvMUcU0CfZFtreJ08rzyiI3wHyUob0p5BtzagEqTiIMuRI19MWUvu+pP O/6DNRcivnP+H5gGLmT+g6Z9UcZouWdxtLBiyyWvfcYjtEMYtVAvUl/Lme+P/95o50cr YDDlVMCL5K9ITUbU+K2X04Qce7JeXYGpJjakLD131SlEKSrWwvMFoWMWe6BZWIOnthoM 4yUJnMwnBypNrVcOFn11bm0e4tPdhBhWX124nOrYAIn9Di+1M5GbaMuyIgsC871kFZwO mE3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nfN9ECNIOkfiXnEZrA+dHVVTa0TASVrQuDcqOk94fvU=; b=cujO6NA7dsme0odWuvLwpEnLDzPcAmb49DoJfQ3lcfi/ATe02EiZzAkvAmOUZyTDnB g91p0fty5qCqq7+VqlupEfy1q/8Z8w5697JdCDvLdmOuYsujC9z8TM5kX4Xri+5bNx+T lDGEZHqcOAnFa4qFuLxxoVHjqHxnKY8WX3K4Tyu9YnbAEyoKaX60XV0gUqGbcMWmuO5V JGFm1U+bg5sGE6r7ypNls9Zvw7fDhR4RnXh5KFRFaqnzLH3acNoDNUpTj/FifGdlVxSE OWbqqh8lJihjVTNfbVlItSJjgB9gt3VthHfv99to2obaS1vzLHK40m2Iug2jh2Vkv7S2 TL/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X2FbamX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si110972ejj.498.2020.07.08.08.41.54; Wed, 08 Jul 2020 08:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=X2FbamX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730430AbgGHPl3 (ORCPT + 99 others); Wed, 8 Jul 2020 11:41:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730418AbgGHPl0 (ORCPT ); Wed, 8 Jul 2020 11:41:26 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AF2D52082E; Wed, 8 Jul 2020 15:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594222886; bh=FQg28pZt+7K/1SzykRlPYg/cmwSTa5s6SlM60cpHuSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X2FbamX8xQT45e88Bp/5Ehg6gBwl3jm/dTrZseNGD3cEMffo4KzGbtAHNSNL+22ev lyCTR92N9H9o/w9/8yVILJ0Jac3ryTxFKf1Fif2oS41sx8aaVIYH2GazhsWzXoBI61 s8a+OY1WAs9j9D7B51xm09rD29FIAYhA/vrs5c34= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Hyeongseok.Kim" , Sungjong Seo , Namjae Jeon , Sasha Levin , linux-fsdevel@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 07/30] exfat: Set the unused characters of FileName field to the value 0000h Date: Wed, 8 Jul 2020 11:40:53 -0400 Message-Id: <20200708154116.3199728-7-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200708154116.3199728-1-sashal@kernel.org> References: <20200708154116.3199728-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Hyeongseok.Kim" [ 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 Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin --- 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 4b91afb0f0515..349ca0c282c2c 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; + } } } -- 2.25.1