From: Alessandro Astone <ales.astone@gmail.com>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ales.astone@gmail.com, ntfs3@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: [PATCH] ntfs3: Fix showing umask option
Date: Sat, 27 Nov 2021 14:51:05 +0100 [thread overview]
Message-ID: <20211127135105.27795-1-ales.astone@gmail.com> (raw)
fmask and dmask are 16 bit unsigned, but without the explicit cast
printf sign-extends to 32 bit making it print fmask=37777600022
when it should print fmask=0022.
Signed-off-by: Alessandro Astone <ales.astone@gmail.com>
---
fs/ntfs3/super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 29813200c7af..815a597a45ab 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -518,9 +518,9 @@ static int ntfs_show_options(struct seq_file *m, struct dentry *root)
seq_printf(m, ",gid=%u",
from_kgid_munged(user_ns, opts->fs_gid));
if (opts->fmask)
- seq_printf(m, ",fmask=%04o", ~opts->fs_fmask_inv);
+ seq_printf(m, ",fmask=%04o", (u16)~opts->fs_fmask_inv);
if (opts->dmask)
- seq_printf(m, ",dmask=%04o", ~opts->fs_dmask_inv);
+ seq_printf(m, ",dmask=%04o", (u16)~opts->fs_dmask_inv);
if (opts->nls)
seq_printf(m, ",iocharset=%s", opts->nls->charset);
else
--
2.33.1
reply other threads:[~2021-11-27 13:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20211127135105.27795-1-ales.astone@gmail.com \
--to=ales.astone@gmail.com \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).