From: Yifan Feng <evanfengff@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Eric Sandeen <sandeen@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Yifan Feng <evanfengff@gmail.com>
Subject: [PATCH] udf: parse umask, mode and dmode as octal again
Date: Tue, 1 Dec 2026 16:22:27 -0800 [thread overview]
Message-ID: <20261202002227.71885-1-evanfengff@gmail.com> (raw)
Before the conversion to the new mount API these three options were
parsed with match_octal(). Now they are fsparam_u32, which takes a
number without a leading zero as decimal. So mode=644,dmode=755 gives
files the permissions 0204 and directories 0363.
udf_show_options() prints the values in octal without a leading zero,
so they are also read back as other values. mount(8) passes the
options of /proc/mounts again when it is given the mount point only,
and every such remount changes the permissions:
# mount -o umask=022 /dev/vda /mnt
# findmnt -no OPTIONS /mnt
rw,relatime,umask=22,iocharset=utf8
# mount -o remount,noatime /mnt
# findmnt -no OPTIONS /mnt
rw,noatime,umask=26,iocharset=utf8
Use fsparam_u32oct for the three options.
Fixes: c4e89cc674ac ("udf: convert to new mount API")
Signed-off-by: Yifan Feng <evanfengff@gmail.com>
---
Tested in QEMU with mount(8) from util-linux 2.38.1. umask=8 and mode=0x1a4 are rejected again, as before the conversion. The checkpatch warnings are the existing style of the table.
Found and written with the help of an AI coding assistant.
fs/udf/super.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index a81a8509524a..5a07271b9745 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -502,7 +502,7 @@ static const struct fs_parameter_spec udf_param_spec[] = {
fsparam_flag ("longad", Opt_longad),
fsparam_string ("gid", Opt_gid),
fsparam_string ("uid", Opt_uid),
- fsparam_u32 ("umask", Opt_umask),
+ fsparam_u32oct ("umask", Opt_umask),
fsparam_u32 ("session", Opt_session),
fsparam_u32 ("lastblock", Opt_lastblock),
fsparam_u32 ("anchor", Opt_anchor),
@@ -512,8 +512,8 @@ static const struct fs_parameter_spec udf_param_spec[] = {
fsparam_u32 ("rootdir", Opt_rootdir),
fsparam_flag ("utf8", Opt_utf8),
fsparam_string ("iocharset", Opt_iocharset),
- fsparam_u32 ("mode", Opt_fmode),
- fsparam_u32 ("dmode", Opt_dmode),
+ fsparam_u32oct ("mode", Opt_fmode),
+ fsparam_u32oct ("dmode", Opt_dmode),
{}
};
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
--
2.39.3 (Apple Git-146)
reply other threads:[~2026-12-02 0:22 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=20261202002227.71885-1-evanfengff@gmail.com \
--to=evanfengff@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sandeen@redhat.com \
/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®