diff options
author | Jakob Unterwurzacher <jakobunt@gmail.com> | 2019-07-16 23:09:07 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-07-17 11:37:09 +0200 |
commit | d34a40082db3ffca8de66bfa4df50951101bdae5 (patch) | |
tree | 152d3ae3a3bfd01bace2ec880bd868c0b16619ea /src/shared/path-lookup.h | |
parent | 31cd5f63ce86a0784c4ef869c4d323a11ff14adc (diff) | |
download | systemd-d34a40082db3ffca8de66bfa4df50951101bdae5.tar.gz |
mount-util: bind_remount: avoid calling statvfs
The commit
"util: Do not clear parent mount flags when setting up namespaces"
introduced a statvfs call read the flags of the original mount
and have them applied to the bind mount.
This has two problems:
(1) The mount flags returned by statvfs(2) do not match the flags
accepted by mount(2). For example, the value 4096 means ST_RELATIME
when returned by statvfs(2), but means MS_BIND when passed to mount(2).
(2) A call to statvfs blocks indefinitely when ran against a disconnected
network drive ( https://github.com/systemd/systemd/issues/12667 ).
We already use libmount to parse `/proc/self/mountinfo` but did not use the
mount flag information from there. This patch changes that to use the mount
flags parsed by libmount instead of calling statvfs. Only if getting the
flags through libmount fails we call statvfs.
Fixes https://github.com/systemd/systemd/issues/12667
Diffstat (limited to 'src/shared/path-lookup.h')
0 files changed, 0 insertions, 0 deletions