From: "Thomas Kühnel" <thomas.kuehnel@avm.de>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org,
"Thomas Kühnel" <thomas.kuehnel@avm.de>,
"Nicolas Schier" <n.schier@avm.de>
Subject: [PATCH 1/3] fs/ntfs3: fix endian conversion in ni_fname_name
Date: Tue, 7 Dec 2021 11:24:53 +0100 [thread overview]
Message-ID: <20211207102454.576906-2-thomas.kuehnel@avm.de> (raw)
In-Reply-To: <20211207102454.576906-1-thomas.kuehnel@avm.de>
ni_fname_name called ntfs_cmp_names_cpu which assumes that the first
string is in CPU byte order and the second one in little endian.
In this case both strings are little endian so ntfs_cmp_names is the
correct function to call.
Signed-off-by: Thomas Kühnel <thomas.kuehnel@avm.de>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
---
fs/ntfs3/frecord.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 6f47a9c17f89..f3afdc91af76 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -1588,6 +1588,7 @@ struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
{
struct ATTRIB *attr = NULL;
struct ATTR_FILE_NAME *fname;
+ struct le_str *fns;
*le = NULL;
@@ -1610,7 +1611,8 @@ struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
if (uni->len != fname->name_len)
goto next;
- if (ntfs_cmp_names_cpu(uni, (struct le_str *)&fname->name_len, NULL,
+ fns = (struct le_str *)&fname->name_len;
+ if (ntfs_cmp_names(uni->name, uni->len, fns->name, fns->len, NULL,
false))
goto next;
--
2.25.1
next prev parent reply other threads:[~2021-12-07 10:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 10:24 [PATCH 0/3] fs/ntfs3: Fixes for big endian systems Thomas Kühnel
2021-12-07 10:24 ` Thomas Kühnel [this message]
2021-12-07 16:00 ` [PATCH 1/3] fs/ntfs3: fix endian conversion in ni_fname_name kernel test robot
2021-12-09 10:50 ` Thomas Kühnel
2021-12-07 10:24 ` [PATCH 2/3] fs/ntfs3: add functions to modify LE bitmaps Thomas Kühnel
2021-12-07 17:31 ` kernel test robot
2021-12-07 10:24 ` [PATCH 3/3] fs/ntfs3: use _le variants of bitops functions Thomas Kühnel
2022-12-30 12:07 ` [PATCH 0/3] fs/ntfs3: Fixes for big endian systems Konstantin Komarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211207102454.576906-2-thomas.kuehnel@avm.de \
--to=thomas.kuehnel@avm.de \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=n.schier@avm.de \
--cc=ntfs3@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®