summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-10-02 20:39:08 +0200
committerGitHub <noreply@github.com>2017-10-02 20:39:08 +0200
commitebfa2c158e639522ac2dbf57283bdc6e3d76be87 (patch)
tree9a606eb336c6dc02b2625887335470050792125a /src/shared
parentMerge pull request #6960 from keszybz/hwdb-update (diff)
parentmount-util: add fusectl to list of API VFS (diff)
downloadsystemd-ebfa2c158e639522ac2dbf57283bdc6e3d76be87.tar.xz
systemd-ebfa2c158e639522ac2dbf57283bdc6e3d76be87.zip
Merge pull request #6943 from poettering/dissect-ro
Automatically recognize that "squashfs" and "iso9660" area always read-only
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/dissect-image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c
index f11b522558..243a46f2e3 100644
--- a/src/shared/dissect-image.c
+++ b/src/shared/dissect-image.c
@@ -591,6 +591,9 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI
if (streq_ptr(p->fstype, "crypto_LUKS"))
m->encrypted = true;
+
+ if (p->fstype && fstype_is_ro(p->fstype))
+ p->rw = false;
}
*ret = m;
@@ -681,7 +684,7 @@ static int mount_partition(
p = where;
/* If requested, turn on discard support. */
- if (STR_IN_SET(fstype, "btrfs", "ext4", "vfat", "xfs") &&
+ if (fstype_can_discard(fstype) &&
((flags & DISSECT_IMAGE_DISCARD) ||
((flags & DISSECT_IMAGE_DISCARD_ON_LOOP) && is_loop_device(m->node))))
options = "discard";