Re: [PATCH 01/26] copy_tree(): don't set ->mnt_mountpoint on the root of copy

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

 



Al Viro <viro@xxxxxxxxxxxxxxxxxx> writes:

> It never made any sense - neither when copy_tree() had been introduced
> (2.4.11-pre5), nor at any point afterwards.  Mountpoint is meaningless
> without parent mount and the root of copied tree has no parent until we get
> around to attaching it somewhere.  At that time we'll have mountpoint set;
> before that we have no idea which dentry will be used as mountpoint.
> IOW, copy_tree() should just leave the default value.

I will just note that does not result in dst_mnt->mnt_mountpoint
being left as NULL.

Rather dst_mnt->mnt_mountpoint retains the value that clone_mnt
sets it to which is dst_mnt->mnt.mnt_root.

It would be nice to have a note that says something like leaving
dst_mnt->mnt_parent and dst_mnt->mnt_mountpoint alone indicates that the
mount is not mounted anywhere, and that the current situation of just
setting one of them completely confusing.

> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> ---
>  fs/namespace.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index e13d9ab4f564..5eeb17c39fcb 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -2259,7 +2259,6 @@ struct mount *copy_tree(struct mount *src_root, struct dentry *dentry,
>  		return dst_mnt;
>  
>  	src_parent = src_root;
> -	dst_mnt->mnt_mountpoint = src_root->mnt_mountpoint;
>  
>  	list_for_each_entry(src_root_child, &src_root->mnt_mounts, mnt_child) {
>  		if (!is_subdir(src_root_child->mnt_mountpoint, dentry))




[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