]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: cleanup --fake mode
authorKarel Zak <kzak@redhat.com>
Tue, 1 Aug 2023 12:49:48 +0000 (14:49 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 1 Aug 2023 12:49:48 +0000 (14:49 +0200)
commitb42e4e2350a26b13a6165b78990e8814535ceb80
tree04395c114c1c15a5bef7c069500e8cb9560152b6
parente3a1b5e6d0db08acaf3fbd72d5680c945d68f10d
libmount: cleanup --fake mode

It was originally designed to play nasty games with /etc/mtab (mount
when /etc is read-only and update later when it's write-able).

The --fake is completely useless with the new API due to complexity
where we cannot skip any step, because the next stuff depends on it.
So, it makes more sense skip all functionality where libmount does
anything significant.

This commit add --fake check to hooks logic to skip all hooks as the
hooks are place where libmount implements mount related invasive
operations (create mountpoint, namespaces, create superblock, move,
mount, etc.).

Frankly, --fake without mtab is useless.

Fixes: https://github.com/util-linux/util-linux/issues/2395
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/hook_mount.c
libmount/src/hook_mount_legacy.c
libmount/src/hooks.c
sys-utils/mount.8.adoc