From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] blob_to_mnt(): kern_unmount() is needed to undo kern_mount()
Date: Fri, 20 May 2022 14:02:52 -0500 [thread overview]
Message-ID: <87sfp410yr.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <YocJqCkNoTaehfYL@zeniv-ca.linux.org.uk> (Al Viro's message of "Fri, 20 May 2022 03:23:20 +0000")
Al Viro <viro@zeniv.linux.org.uk> writes:
> plain mntput() won't do.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
It is already performing kern_unmount on the happy path
so I don't see how it will be a problem to call kern_unmount
on a failure path.
Do you want to merge this through your tree?
> kernel/usermode_driver.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/usermode_driver.c b/kernel/usermode_driver.c
> index 9dae1f648713..8303f4c7ca71 100644
> --- a/kernel/usermode_driver.c
> +++ b/kernel/usermode_driver.c
> @@ -28,7 +28,7 @@ static struct vfsmount *blob_to_mnt(const void *data, size_t len, const char *na
>
> file = file_open_root_mnt(mnt, name, O_CREAT | O_WRONLY, 0700);
> if (IS_ERR(file)) {
> - mntput(mnt);
> + kern_unmount(mnt);
> return ERR_CAST(file);
> }
>
> @@ -38,7 +38,7 @@ static struct vfsmount *blob_to_mnt(const void *data, size_t len, const char *na
> if (err >= 0)
> err = -ENOMEM;
> filp_close(file, NULL);
> - mntput(mnt);
> + kern_unmount(mnt);
> return ERR_PTR(err);
> }
next prev parent reply other threads:[~2022-05-20 19:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 3:17 [PATCHES] stuff from the last cycle that missed the window Al Viro
2022-05-20 3:17 ` [PATCH] fs/namei.c:reserve_stack(): tidy up the call of try_to_unlazy() Al Viro
2022-05-20 11:48 ` Christian Brauner
2022-05-20 3:18 ` [PATCH] get rid of dead code in legitimize_root() Al Viro
2022-05-20 3:20 ` [PATCH] uninline may_mount() and don't opencode it in fspick(2)/fsopen(2) Al Viro
2022-05-20 3:20 ` [PATCH] linux/mount.h: trim includes Al Viro
2022-05-20 3:22 ` [PATCH] m->mnt_root->d_inode->i_sb is a weird way to spell m->mnt_sb Al Viro
2022-05-20 3:23 ` [PATCH] blob_to_mnt(): kern_unmount() is needed to undo kern_mount() Al Viro
2022-05-20 3:23 ` [PATCH] move mount-related externs from fs.h to mount.h Al Viro
2022-05-20 11:54 ` Christian Brauner
2022-05-20 19:02 ` Eric W. Biederman [this message]
2022-05-20 11:45 ` [PATCH] linux/mount.h: trim includes Christian Brauner
2022-05-20 11:44 ` [PATCH] uninline may_mount() and don't opencode it in fspick(2)/fsopen(2) Christian Brauner
2022-05-20 11:43 ` [PATCH] get rid of dead code in legitimize_root() 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=87sfp410yr.fsf@email.froward.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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