From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-fsdevel@vger.kernel.org,
Christian Brauner <brauner@kernel.org>
Subject: Re: [PATCH V2 3/3] fat: Convert to new uid/gid option parsing helpers
Date: Wed, 03 Jul 2024 14:20:14 +0900 [thread overview]
Message-ID: <87a5izrr01.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <1a67d2a8-0aae-42a2-9c0f-21cd4cd87d13@redhat.com> (Eric Sandeen's message of "Tue, 2 Jul 2024 17:45:57 -0500")
Eric Sandeen <sandeen@redhat.com> writes:
> Convert to new uid/gid option parsing helpers
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Looks good.
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Thanks.
> ---
> fs/fat/inode.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index b83b39f2f69b..8fbf5edb7aa2 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -1091,8 +1091,8 @@ static const struct constant_table fat_param_conv[] = {
> /* Core options. See below for vfat and msdos extras */
> const struct fs_parameter_spec fat_param_spec[] = {
> fsparam_enum ("check", Opt_check, fat_param_check),
> - fsparam_u32 ("uid", Opt_uid),
> - fsparam_u32 ("gid", Opt_gid),
> + fsparam_uid ("uid", Opt_uid),
> + fsparam_gid ("gid", Opt_gid),
> fsparam_u32oct ("umask", Opt_umask),
> fsparam_u32oct ("dmask", Opt_dmask),
> fsparam_u32oct ("fmask", Opt_fmask),
> @@ -1161,8 +1161,6 @@ int fat_parse_param(struct fs_context *fc, struct fs_parameter *param,
> struct fat_mount_options *opts = fc->fs_private;
> struct fs_parse_result result;
> int opt;
> - kuid_t uid;
> - kgid_t gid;
>
> /* remount options have traditionally been ignored */
> if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE)
> @@ -1209,16 +1207,10 @@ int fat_parse_param(struct fs_context *fc, struct fs_parameter *param,
> opts->sys_immutable = 1;
> break;
> case Opt_uid:
> - uid = make_kuid(current_user_ns(), result.uint_32);
> - if (!uid_valid(uid))
> - return -EINVAL;
> - opts->fs_uid = uid;
> + opts->fs_uid = result.uid;
> break;
> case Opt_gid:
> - gid = make_kgid(current_user_ns(), result.uint_32);
> - if (!gid_valid(gid))
> - return -EINVAL;
> - opts->fs_gid = gid;
> + opts->fs_gid = result.gid;
> break;
> case Opt_umask:
> opts->fs_fmask = opts->fs_dmask = result.uint_32;
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2024-07-03 5:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 22:39 [PATCH V2 0/3] fat: convert to the new mount API Eric Sandeen
2024-07-02 22:41 ` [PATCH V2 1/3] fat: move debug into fat_mount_options Eric Sandeen
2024-07-03 5:19 ` OGAWA Hirofumi
2024-07-02 22:44 ` [PATCH V2 2/3] fat: Convert to new mount api Eric Sandeen
2024-07-03 5:19 ` OGAWA Hirofumi
2024-07-03 5:21 ` OGAWA Hirofumi
2024-07-02 22:45 ` [PATCH V2 3/3] fat: Convert to new uid/gid option parsing helpers Eric Sandeen
2024-07-03 5:20 ` OGAWA Hirofumi [this message]
2024-07-03 8:49 ` [PATCH V2 0/3] fat: convert to the new mount API Christian Brauner
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=87a5izrr01.fsf@mail.parknet.co.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@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