mount-util: store mount flags in "todo" list in + handle submounts gracefully
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Mar 2021 13:07:32 +0000 (14:07 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 7 May 2021 09:58:19 +0000 (11:58 +0200)
commitbad107f1518452c725f0142bb223f77acf1a62b5
treea187a15637d071a37392b9b844d0732321af719e
parent64ec40ddc563542113a161efad28e713c219ee7a
mount-util: store mount flags in "todo" list in + handle submounts gracefully

This replaces the "todo" set with a "todo" hash map that stores the
mount flags we found. This makes an explicit call to get_mount_flags()
unncessary, since we have the flags handy right-away, and lowers our
work from O(n^2) to O(n). Nice!

The "done" set is also improved slightly: we'll use more modern ways to
allocate it, via set_ensure_consume(), and freeing-via-hash_ops.

Finally, failures on submount remounts are now handled gracefully,
there are just too many reasons why they might fail, given NFS, autofs,
FUSE which weird access controls, where even root might lack the privs
to do something.

Fixes: #16156
(cherry picked from commit ba8dced2a60d8535bf6d685e2fd164e5ff3f056b)
src/shared/mount-util.c