Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

copy_mnt_ns(): use the regular mechanism for freeing empty mnt_ns on failure

Now that free_mnt_ns() works prior to mnt_ns_tree_add(), there's no need for
an open-coded analogue free_mnt_ns() there - yes, we do avoid one call_rcu()
use per failing call of clone() or unshare(), if they fail due to OOM in that
particular spot, but it's not really worth bothering.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 7bb4c851 1b966c44

+1 -3
+1 -3
fs/namespace.c
··· 4184 4184 copy_flags |= CL_SLAVE; 4185 4185 new = copy_tree(old, old->mnt.mnt_root, copy_flags); 4186 4186 if (IS_ERR(new)) { 4187 + emptied_ns = new_ns; 4187 4188 namespace_unlock(); 4188 - ns_free_inum(&new_ns->ns); 4189 - dec_mnt_namespaces(new_ns->ucounts); 4190 - mnt_ns_release(new_ns); 4191 4189 return ERR_CAST(new); 4192 4190 } 4193 4191 if (user_ns != ns->user_ns) {