]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mount: separate the flags accessed only under namespace_sem
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 21 Jun 2025 22:06:19 +0000 (18:06 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Jun 2025 23:03:29 +0000 (19:03 -0400)
commit406fea79992561f47fd3511dd8b7c8abeeff7045
tree077af00d0d9850fcfdf1fe0e4a96ebf65c42eed8
parent493a4bebf5157a5da64e36f8d468ff80a859b563
mount: separate the flags accessed only under namespace_sem

Several flags are updated and checked only under namespace_sem; we are
already making use of that when we are checking them without mount_lock,
but we have to hold mount_lock for all updates, which makes things
clumsier than they have to be.

Take MNT_SHARED, MNT_UNBINDABLE, MNT_MARKED and MNT_UMOUNT_CANDIDATE
into a separate field (->mnt_t_flags), renaming them to T_SHARED,
etc. to avoid confusion.  All accesses must be under namespace_sem.

That changes locking requirements for mnt_change_propagation() and
set_mnt_shared() - only namespace_sem is needed now.  The same goes
for SET_MNT_MARKED et.al.

There might be more flags moved from ->mnt_flags to that field;
this is just the initial set.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Documentation/filesystems/propagate_umount.txt
fs/mount.h
fs/namespace.c
fs/pnode.c
fs/pnode.h
include/linux/mount.h