Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp20639132ybl; Sun, 5 Jan 2020 07:25:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwK+sW+vhnCQyDFhYpwVDAg402kTNQbNGf6Rtu+Py3n+3eWKfPgfin3WC783+3xukYwdQp5 X-Received: by 2002:a9d:7d99:: with SMTP id j25mr94393775otn.226.1578237949825; Sun, 05 Jan 2020 07:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578237949; cv=none; d=google.com; s=arc-20160816; b=uWo1gE7G4Erx6BDByk85Hn/YgniVWbE2FpEANzwcg8aaiv1FlsK93xnKWx+wkSa4CH wI4fYEj+heqHqn7d+moU61UkQwai3X3o1hNuty/1X0s49i63Oza8JJbRZtnfk5gXIWLV ljsdXkEA7Ty+qvSGNo/n8wbkzP8dcEmZGpER/QvkLo6xvumPZ8GdJJgMdRif6iPVz1v5 GeOPeXesECzmOyenz/64DN86X4a/lVdrcvGcSvt96W64sKHDt0rWxoRY+jUwNGjkoTtj ym1lSNps5bkYTPwOnrI+AvdYOykP29ppAII+kD5yEKLgjiJ0Hrh7M6KmxlefpCYpt2kp EZaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4F9+RY0yU9fqVfTSeicS1qBjnlshzGXW5AwJXhtTU9s=; b=UqJ0up4NDDH7f016+ttMPewm4vpk2FeEoxToTMiLKmWJSHUy8z9h8CXFSBDhMlHu3Y LcbjQO0OgYkgOhyElKaSMdN18uZvHW0GkVAiF7zVDVPsvp37ZqlNgNXoarfB5XFdD+kC i3JjLzTGhWzDdzC7bf3RHhInH5Cfep2d5gf9NFGGfkVUJtz1LxgAFceeAZmmjVm5X6Ur 3DxwOu8jfVV7zzuYANMgYTRh/5D35AhrY+uTnqEpX0sB/qlT3u1auZKZwPdv5B0olCcz Foo6Ly2CyTsYMLrcan+jk2LDs8idOiR7t/Nj0GXOI4kMBjpajp+2qk30xecJtiQmKPkQ HSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E18QoDhn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p25si34859048oto.191.2020.01.05.07.25.36; Sun, 05 Jan 2020 07:25:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E18QoDhn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726427AbgAEPYv (ORCPT + 99 others); Sun, 5 Jan 2020 10:24:51 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33039 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbgAEPYv (ORCPT ); Sun, 5 Jan 2020 10:24:51 -0500 Received: by mail-wr1-f68.google.com with SMTP id b6so47010085wrq.0; Sun, 05 Jan 2020 07:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4F9+RY0yU9fqVfTSeicS1qBjnlshzGXW5AwJXhtTU9s=; b=E18QoDhneNFDiyLfRMo2yBdct25MXHmDNVcq2fDINCHw6wdWiuCwG7Fv8YCu+z373m zQ0FfWrp+Pc9Y1Pkrj7Z50QO9TsZbIuGTm9O3adSW70qeoX0YL42SCMioOeJW0XvdCOD 6oF7MIufHhxF7babum0iXZvAvBgRi+hJoo3X21mDv5ZhQU9LWbPDWu6vRRC/m39b7jMh clQpzSaNQy7e1yZs8CPlaO5vkHlQMebiFfWEoWB4o46Vfh/FaqO/1XiWV0p6v+3+ckn5 a+7sIydrU7OmEsPMG7N3PWu556IRjBt6Hd+dMJR+7fdCYP4NylzAkjI5lpZ7bJYHNSco cfAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4F9+RY0yU9fqVfTSeicS1qBjnlshzGXW5AwJXhtTU9s=; b=FiYj31QT1J5ORY/F+lX7eJ5zOl8Q7KeWkFn9je/T5fpv4J7xLzNIJ+r55J90dzdAEY EriFbWmIRu2PQeChv1kqG8I9YGoohHvorXwfhpvFGilJsRhUWVXq/cIGneP2cdS0wrpn Xuje9NpNWAKafQW1yqDl0KLLIuDZeX19ejlTdufd1clk5lMQZR7D3ySmBtiAKt0/vYre H3Art0Mu3Ze36va81QfYx+CBa8CHAl4KOxFK5NGvckP/hll/MXgfobuIYNJyNBQW9+mo bPULZEorG+qGTiUlSQGGnCWoctGjxDnrjNDqQVjG3AhYP6RSES0fBWUG5zhUVBokLnoR bHyQ== X-Gm-Message-State: APjAAAUCXRtc5TefkW41cyWl5DS/Y3mmQLmm6WJphlkK47c0Rqizrqju Vo2pF+utkC/bQc331pUh7lQ= X-Received: by 2002:adf:f78e:: with SMTP id q14mr98169159wrp.186.1578237889014; Sun, 05 Jan 2020 07:24:49 -0800 (PST) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id h66sm20616568wme.41.2020.01.05.07.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2020 07:24:47 -0800 (PST) Date: Sun, 5 Jan 2020 16:24:47 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Namjae Jeon Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, gregkh@linuxfoundation.org, valdis.kletnieks@vt.edu, hch@lst.de, sj1557.seo@samsung.com, linkinjeon@gmail.com Subject: Re: [PATCH v9 10/13] exfat: add nls operations Message-ID: <20200105152447.jo27m7jgskyu2dos@pali> References: <20200102082036.29643-1-namjae.jeon@samsung.com> <20200102082036.29643-11-namjae.jeon@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f2e4tgqxncq2o4tg" Content-Disposition: inline In-Reply-To: <20200102082036.29643-11-namjae.jeon@samsung.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --f2e4tgqxncq2o4tg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thursday 02 January 2020 16:20:33 Namjae Jeon wrote: > This adds the implementation of nls operations for exfat. >=20 > Signed-off-by: Namjae Jeon > Signed-off-by: Sungjong Seo > --- > fs/exfat/nls.c | 809 +++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 809 insertions(+) > create mode 100644 fs/exfat/nls.c >=20 > diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c > new file mode 100644 > index 000000000000..af52328e28ff > --- /dev/null > +++ b/fs/exfat/nls.c =2E.. > +int exfat_nls_cmp_uniname(struct super_block *sb, unsigned short *a, > + unsigned short *b) > +{ > + int i; > + > + for (i =3D 0; i < MAX_NAME_LENGTH; i++, a++, b++) { > + if (exfat_nls_upper(sb, *a) !=3D exfat_nls_upper(sb, *b)) > + return 1; > + if (*a =3D=3D 0x0) > + return 0; > + } > + return 0; > +} Hello, this function returns wrong result when second string (b) is longer then first string (a). Also it is a best practise to first check for end-of-string and then access/work with i-th element of string. --=20 Pali Roh=C3=A1r pali.rohar@gmail.com --f2e4tgqxncq2o4tg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQS4VrIQdKium2krgIWL8Mk9A+RDUgUCXhH/vAAKCRCL8Mk9A+RD Uqv7AJwIkABv+Bpvw7Z2sHDERYMAUNrI1QCeO5I7iyE5/RVgyXEYwonl4aM0vDQ= =BcPO -----END PGP SIGNATURE----- --f2e4tgqxncq2o4tg--