diff options
| author | Karel Zak <kzak@redhat.com> | 2024-11-19 11:54:00 +0100 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2024-11-19 11:54:00 +0100 |
| commit | 5e9711473fc871155017c7747364b9e4ae2ecfb9 (patch) | |
| tree | a835eda866090858846114282b2343b20c44832c /libmount/src/hook_loopdev.c | |
| parent | 4c4b248c68149089c8be2f830214bb2be693307e (diff) | |
| download | util-linux-5e9711473fc871155017c7747364b9e4ae2ecfb9.tar.gz | |
libmount: support X-mount.noloop
libmount automatically creates a loop device and mounts it if the
source of the mount is a regular file that contains a well-known
filesystem. However, in some cases, this feature may be unwanted. The
new mount option "X-mount.noloop" forces libmount to use the file
directly as the mount source.
Addresses: https://github.com/util-linux/util-linux/pull/3288
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/hook_loopdev.c')
| -rw-r--r-- | libmount/src/hook_loopdev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libmount/src/hook_loopdev.c b/libmount/src/hook_loopdev.c index c01d536ce1..a19ddab3be 100644 --- a/libmount/src/hook_loopdev.c +++ b/libmount/src/hook_loopdev.c @@ -423,6 +423,9 @@ static int is_loopdev_required(struct libmnt_context *cxt, struct libmnt_optlist || mnt_context_propagation_only(cxt)) return 0; + if (mnt_optlist_get_named(ol, "X-mount.noloop", cxt->map_userspace)) + return 0; + src = mnt_fs_get_srcpath(cxt->fs); if (!src) return 0; /* backing file not set */ |
