ntfs3.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] ntfs3: Fix showing umask option
@ 2021-11-27 13:51 Alessandro Astone
  0 siblings, 0 replies; only message in thread
From: Alessandro Astone @ 2021-11-27 13:51 UTC (permalink / raw)
  To: Konstantin Komarov; +Cc: ales.astone, ntfs3, linux-kernel

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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-27 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 13:51 [PATCH] ntfs3: Fix showing umask option Alessandro Astone

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).