summaryrefslogtreecommitdiff
path: root/lib/crypto/mpi
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-06-24 18:12:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2025-06-29 19:03:30 -0400
commit955336e204ab59301ff8b1f75a98a226f5a98782 (patch)
tree14408003499c71d9fa4a623c641d5485e1204cd4 /lib/crypto/mpi
parentef86251194de9b31f7efcf70ea480ebe736e9e60 (diff)
do_make_slave(): choose new master sanely
When mount changes propagation type so that it doesn't propagate events any more (MS_PRIVATE, MS_SLAVE, MS_UNBINDABLE), we need to make sure that event propagation between other mounts is unaffected. We need to make sure that events from peers and master of that mount (if any) still reach everything that used to be on its ->mnt_slave_list. If mount has neither peers nor master, we simply need to dissolve its ->mnt_slave_list and clear ->mnt_master of everything in there. If mount has peers, we transfer everything in ->mnt_slave_list of this mount into that of some of those peers (and adjust ->mnt_master accordingly). If mount has a master but no peers, we transfer everything in ->mnt_slave_list of this mount into that of its master (adjusting ->mnt_master, etc.). There are two problems with the current implementation: * there's a long-obsolete logics in choosing the peer - once upon a time it made sense to prefer the peer that had the same ->mnt_root as our mount, but that had been pointless since 2014 ("smarter propagate_mnt()") * the most common caller of that thing is umount_tree() taking the mounts out of propagation graph. In that case it's possible to have ->mnt_slave_list contents moved many times, since the replacement master is likely to be taken out by the same umount_tree(), etc. Take the choice of replacement master into a separate function (propagation_source()) and teach it to skip the candidates that are going to be taken out. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'lib/crypto/mpi')
0 files changed, 0 insertions, 0 deletions