Re: [PATCH] blob_to_mnt(): kern_unmount() is needed to undo kern_mount()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Al Viro <viro@xxxxxxxxxxxxxxxxxx> writes:

> plain mntput() won't do.
>
> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Reviewed-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>

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);
>  	}



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux