Re: [PATCH 16/26] make commit_tree() usable in same-namespace move case

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

 



On Tue, Jun 10, 2025 at 09:21:38AM +0100, Al Viro wrote:
> Once attach_recursive_mnt() has created all copies of original subtree,
> it needs to put them in place(s).
> 
> Steps needed for those are slightly different:
> 	1) in 'move' case, original copy doesn't need any rbtree
> manipulations (everything's already in the same namespace where it will
> be), but it needs to be detached from the current location
> 	2) in 'attach' case, original may be in anon namespace; if it is,
> all those mounts need to removed from their current namespace before
> insertion into the target one
> 	3) additional copies have a couple of extra twists - in case
> of cross-userns propagation we need to lock everything other the root of
> subtree and in case when we end up inserting under an existing mount,
> that mount needs to be found (for original copy we have it explicitly
> passed by the caller).
> 
> Quite a bit of that can be unified; as the first step, make commit_tree()
> helper (inserting mounts into namespace, hashing the root of subtree
> and marking the namespace as updated) usable in all cases; (2) and (3)
> are already using it and for (1) we only need to make the insertion of
> mounts into namespace conditional.
> 
> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> ---

Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>




[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