All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Richard Henderson <rth@twiddle.net>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 5/5] fs: remove do_mounts
Date: Sun, 11 Oct 2020 07:17:49 -0700	[thread overview]
Message-ID: <20201011141749.GA126978@roeck-us.net> (raw)
In-Reply-To: <20200917082236.2518236-6-hch@lst.de>

On Thu, Sep 17, 2020 at 10:22:36AM +0200, Christoph Hellwig wrote:
> There are only two callers left, one of which is is in the alpha-specific
> OSF/1 compat code.  Just open code it in both.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  arch/alpha/kernel/osf_sys.c |  7 ++++++-
>  fs/namespace.c              | 25 ++++++++-----------------
>  include/linux/fs.h          |  2 --
>  3 files changed, 14 insertions(+), 20 deletions(-)
> 
> diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
> index 5fd155b13503b5..8acd5101097576 100644
> --- a/arch/alpha/kernel/osf_sys.c
> +++ b/arch/alpha/kernel/osf_sys.c
> @@ -434,6 +434,7 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
                                                                                             ^^^^
>  	struct osf_mount_args tmp;
>  	struct filename *devname;
>  	const char *fstype;
> +	struct path path;
        ^^^^^^^^^^^^^^^^

Someone didn't bother test building this patch.

arch/alpha/kernel/osf_sys.c: In function '__do_sys_osf_mount':
arch/alpha/kernel/osf_sys.c:437:14: error: 'path' redeclared as different kind of symbol

Guenter

>  	int retval;
>  
>  	if (copy_from_user(&tmp, args, sizeof(tmp)))
> @@ -467,7 +468,11 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
>  
>  	if (IS_ERR(devname))
>  		return PTR_ERR(devname);
> -	retval = do_mount(devname.name, dirname, fstype, flags, NULL);
> +	retval = user_path_at(AT_FDCWD, dirname, LOOKUP_FOLLOW, &path);
> +	if (!retval) {
> +		ret = path_mount(devname.name, &path, fstype, flags, NULL);
> +		path_put(&path);
> +	}
>  	putname(devname);
>  	return retval;
>  }
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 12b431b61462b9..2ff373ebeaf27f 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -3193,20 +3193,6 @@ int path_mount(const char *dev_name, struct path *path,
>  			    data_page);
>  }
>  
> -long do_mount(const char *dev_name, const char __user *dir_name,
> -		const char *type_page, unsigned long flags, void *data_page)
> -{
> -	struct path path;
> -	int ret;
> -
> -	ret = user_path_at(AT_FDCWD, dir_name, LOOKUP_FOLLOW, &path);
> -	if (ret)
> -		return ret;
> -	ret = path_mount(dev_name, &path, type_page, flags, data_page);
> -	path_put(&path);
> -	return ret;
> -}
> -
>  static struct ucounts *inc_mnt_namespaces(struct user_namespace *ns)
>  {
>  	return inc_ucount(ns, current_euid(), UCOUNT_MNT_NAMESPACES);
> @@ -3390,10 +3376,11 @@ EXPORT_SYMBOL(mount_subtree);
>  SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
>  		char __user *, type, unsigned long, flags, void __user *, data)
>  {
> -	int ret;
> +	struct path path;
>  	char *kernel_type;
>  	char *kernel_dev;
>  	void *options;
> +	int ret;
>  
>  	kernel_type = copy_mount_string(type);
>  	ret = PTR_ERR(kernel_type);
> @@ -3410,8 +3397,12 @@ SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
>  	if (IS_ERR(options))
>  		goto out_data;
>  
> -	ret = do_mount(kernel_dev, dir_name, kernel_type, flags, options);
> -
> +	ret = user_path_at(AT_FDCWD, dir_name, LOOKUP_FOLLOW, &path);
> +	if (ret)
> +		goto out_options;
> +	ret = path_mount(kernel_dev, &path, kernel_type, flags, options);
> +	path_put(&path);
> +out_options:
>  	kfree(options);
>  out_data:
>  	kfree(kernel_dev);
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 7519ae003a082c..bd9878bdd4bfe9 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2292,8 +2292,6 @@ extern struct vfsmount *kern_mount(struct file_system_type *);
>  extern void kern_unmount(struct vfsmount *mnt);
>  extern int may_umount_tree(struct vfsmount *);
>  extern int may_umount(struct vfsmount *);
> -extern long do_mount(const char *, const char __user *,
> -		     const char *, unsigned long, void *);
>  extern struct vfsmount *collect_mounts(const struct path *);
>  extern void drop_collected_mounts(struct vfsmount *);
>  extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,

  reply	other threads:[~2020-10-11 14:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17  8:22 remove compat_sys_mount Christoph Hellwig
2020-09-17  8:22 ` Christoph Hellwig
2020-09-17  8:22 ` [PATCH 1/5] nfs: simplify nfs4_parse_monolithic Christoph Hellwig
2020-09-17  8:22   ` Christoph Hellwig
2020-09-17  8:22 ` [PATCH 2/5] fs,nfs: lift compat nfs4 mount data handling into the nfs code Christoph Hellwig
2020-09-17 17:16   ` Al Viro
2020-09-17 17:18     ` Christoph Hellwig
2020-09-21  6:48       ` Christoph Hellwig
2020-09-21 16:05         ` Anna Schumaker
2020-09-21 18:11           ` Christoph Hellwig
2020-09-23  3:45             ` Al Viro
2020-09-17  8:22 ` [PATCH 3/5] fs: remove compat_sys_mount Christoph Hellwig
2020-09-17  8:22 ` [PATCH 4/5] alpha: simplify osf_mount Christoph Hellwig
2020-10-11 14:22   ` Guenter Roeck
2020-09-17  8:22 ` [PATCH 5/5] fs: remove do_mounts Christoph Hellwig
2020-09-17  8:22   ` Christoph Hellwig
2020-10-11 14:17   ` Guenter Roeck [this message]
2020-10-11 18:01     ` Al Viro

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=20201011141749.GA126978@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=anna.schumaker@netapp.com \
    --cc=hch@lst.de \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=rth@twiddle.net \
    --cc=trond.myklebust@hammerspace.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.