ns: Fix mnt ns ida handling in copy_mnt_ns()
Jan Kara
reviewerPATCH 1/1 ns: Fix mnt ns ida handling in copy_mnt_ns()
Commit be5f21d3985f ("ns: add ns_common_free()") modified error cleanup and started to free wrong inode number from the ida. Fix it.
--- fs/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namespace.c +1 -1
@@ -4165,7 +4165,7 @@ struct mnt_namespace *copy_mnt_ns(u64 flags, struct mnt_namespace *ns, new =copy_tree (old, old->mnt.mnt_root, copy_flags);if (IS_ERR (new)) {namespace_unlock (); -ns_common_free (ns); +ns_common_free (new_ns);dec_mnt_namespaces (new_ns->ucounts);mnt_ns_release (new_ns);return ERR_CAST (new);
Signature · 1 line
2.51.0
Quoted 4 lines · Jan Kara
Commit
be5f21d3985f("ns: addns_common_free()") modified error cleanup and started to free wrong inode number from the ida. Fix it.
Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.fixes
[1/1] ns: Fix mnt ns ida handling in copy_mnt_ns()
https://git.kernel.org/vfs/vfs/c/502f6e0e7b72
Christian Brauner
maintainerQuoted 15 lines · Christian Brauner
Quoted 4 lines · Jan Kara
Commit
be5f21d3985f("ns: addns_common_free()") modified error cleanup and started to free wrong inode number from the ida. Fix it.Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Quoted 8 lines
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.fixes[1/1] ns: Fix mnt ns ida handling in
copy_mnt_ns()https://git.kernel.org/vfs/vfs/c/502f6e0e7b72
Jan, I think Al fixed this in his series on accident in upstream. So I think we can drop your patch. emptied_ns is cleaned up after namespace_unlock() and will call free_mnt_ns() which will call ns_common_free(). Please take a look at what's in mainline and let me know if you read it the same way!
Jan Kara
reviewerQuoted 22 lines · Christian Brauner
Quoted 21 lines · Christian Brauner
Quoted 4 lines · Jan Kara
Commit
be5f21d3985f("ns: addns_common_free()") modified error cleanup and started to free wrong inode number from the ida. Fix it.Applied to the vfs.fixes branch of the vfs/vfs.git tree. Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.fixes
Quoted 8 lines
Quoted 2 lines
[1/1] ns: Fix mnt ns ida handling in
copy_mnt_ns()https://git.kernel.org/vfs/vfs/c/502f6e0e7b72Jan, I think Al fixed this in his series on accident in upstream. So I think we can drop your patch.
emptied_nsis cleaned up afternamespace_unlock()and will callfree_mnt_ns()which will callns_common_free(). Please take a look at what's in mainline and let me know if you read it the same way!
I've checked it and indeed Al's changes silently fixed this. So all should be fine.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Christian Brauner
maintainerQuoted 9 lines · Jan Kara
Commit
be5f21d3985f("ns: addns_common_free()") modified error cleanup and started to free wrong inode number from the ida. Fix it.Reported-by [email protected]Reported-by [email protected]Tested-by [email protected]Fixes be5f21d3985f ("ns: add ns_common_free()")Signed-off-by Jan Kara <[email protected]>---
Thank you for catching and fixing this!