Re: [PATCH][RFC][CFT] kill vfs_submount(), already

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

 



On Sat 03-05-25 22:29:25, Al Viro wrote:
> The last remaining user of vfs_submount() (tracefs) is easy to convert
> to fs_context_for_submount(); do that and bury that thing, along with
> SB_SUBMOUNT
> 
> If nobody objects, I'm going to throw that into the mount-related pile;
> alternatively, that could be split into kernel/trace.c part (in invariant
> branch, to be pulled by tracefs folks and into the mount pile before
> the rest of the patch).  Preferences?
> 
> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>

...

> @@ -10072,6 +10073,8 @@ static struct vfsmount *trace_automount(struct dentry *mntpt, void *ingore)
>  {
>  	struct vfsmount *mnt;
>  	struct file_system_type *type;
> +	struct fs_context *fc;
> +	int ret;
>  
>  	/*
>  	 * To maintain backward compatibility for tools that mount
> @@ -10081,10 +10084,20 @@ static struct vfsmount *trace_automount(struct dentry *mntpt, void *ingore)
>  	type = get_fs_type("tracefs");
>  	if (!type)
>  		return NULL;
> -	mnt = vfs_submount(mntpt, type, "tracefs", NULL);
> +
> +	fc = fs_context_for_submount(type, mntpt);
> +	if (IS_ERR(fc))
> +		return ERR_CAST(fc);

Missing put_filesystem() here?

> +
> +	ret = vfs_parse_fs_string(fc, "source",
> +				  "tracefs", strlen("tracefs"));
> +	if (!ret)
> +		mnt = fc_mount(fc);
> +	else
> +		mnt = ERR_PTR(ret);
> +
> +	put_fs_context(fc);
>  	put_filesystem(type);
> -	if (IS_ERR(mnt))
> -		return NULL;
>  	return mnt;
>  }

Otherwise looks good so with the fixup feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>
								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR




[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