diff mbox series

cifs: add missing parsing of backupuid

Message ID 20210728063829.15099-1-lsahlber@redhat.com (mailing list archive)
State New, archived
Headers show
Series cifs: add missing parsing of backupuid | expand

Commit Message

Ronnie Sahlberg July 28, 2021, 6:38 a.m. UTC
We lost parsing of backupuid in the switch to new mount API.
Add it back.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/fs_context.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Shyam Prasad N July 28, 2021, 3:28 p.m. UTC | #1
On Wed, Jul 28, 2021 at 12:08 PM Ronnie Sahlberg <lsahlber@redhat.com> wrote:
>
> We lost parsing of backupuid in the switch to new mount API.
> Add it back.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
> ---
>  fs/cifs/fs_context.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
> index 9a59d7ff9a11..eed59bc1d913 100644
> --- a/fs/cifs/fs_context.c
> +++ b/fs/cifs/fs_context.c
> @@ -925,6 +925,13 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
>                 ctx->cred_uid = uid;
>                 ctx->cruid_specified = true;
>                 break;
> +       case Opt_backupuid:
> +               uid = make_kuid(current_user_ns(), result.uint_32);
> +               if (!uid_valid(uid))
> +                       goto cifs_parse_mount_err;
> +               ctx->backupuid = uid;
> +               ctx->backupuid_specified = true;
> +               break;
>         case Opt_backupgid:
>                 gid = make_kgid(current_user_ns(), result.uint_32);
>                 if (!gid_valid(gid))
> --
> 2.30.2
>

Looks good to me.
Might also be worthwhile to check if we missed any other mount option?
diff mbox series

Patch

diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c
index 9a59d7ff9a11..eed59bc1d913 100644
--- a/fs/cifs/fs_context.c
+++ b/fs/cifs/fs_context.c
@@ -925,6 +925,13 @@  static int smb3_fs_context_parse_param(struct fs_context *fc,
 		ctx->cred_uid = uid;
 		ctx->cruid_specified = true;
 		break;
+	case Opt_backupuid:
+		uid = make_kuid(current_user_ns(), result.uint_32);
+		if (!uid_valid(uid))
+			goto cifs_parse_mount_err;
+		ctx->backupuid = uid;
+		ctx->backupuid_specified = true;
+		break;
 	case Opt_backupgid:
 		gid = make_kgid(current_user_ns(), result.uint_32);
 		if (!gid_valid(gid))