fs/ntfs3: Fix [df]mask display in /proc/mounts
authorMarc Aurèle La France <tsi@tuyoix.net>
Wed, 10 Aug 2022 20:28:04 +0000 (14:28 -0600)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 30 Sep 2022 14:39:50 +0000 (17:39 +0300)
ntfs3's dmask and fmask mount options are 16-bit quantities but are displayed
as 1-extended 32-bit values in /proc/mounts.  Fix this by circumventing
integer promotion.

Signed-off-by: Marc Aurèle La France <tsi@tuyoix.net>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/super.c

index af9b7947df64ea0f43626d50e2c852f594b2fa6d..27a36a0b08ec95e86f789367bf1edd085ae749da 100644 (file)
@@ -544,9 +544,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", opts->fs_fmask_inv ^ 0xffff);
        if (opts->dmask)
-               seq_printf(m, ",dmask=%04o", ~opts->fs_dmask_inv);
+               seq_printf(m, ",dmask=%04o", opts->fs_dmask_inv ^ 0xffff);
        if (opts->nls)
                seq_printf(m, ",iocharset=%s", opts->nls->charset);
        else