]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/umount.c
umount: Don't use options from fstab on remount
authoraszlig <aszlig@nix.build>
Mon, 20 Aug 2018 03:33:58 +0000 (05:33 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Aug 2018 17:49:51 +0000 (19:49 +0200)
commit66c91c3a23f684482e33e54c7bbaaf69384b7d11
treec3aadb9c339ea8e1ea0427230bf77fff983b42af
parent4dc7bfdf4f054c291ffb317963e8f8256fe2833b
umount: Don't use options from fstab on remount

The fstab entry may contain comment/application-specific options, like
for example x-systemd.automount or x-initrd.mount.

With the recent switch to libmount, the mount options during remount are
now gathered via mnt_fs_get_options(), which returns the merged fstab
options with the effective options in mountinfo.

Unfortunately if one of these application-specific options are set in
fstab, the remount will fail with -EINVAL.

In systemd 238:

  Remounting '/test-x-initrd-mount' read-only in with options
  'errors=continue,user_xattr,acl'.

In systemd 239:

  Remounting '/test-x-initrd-mount' read-only in with options
  'errors=continue,user_xattr,acl,x-initrd.mount'.
  Failed to remount '/test-x-initrd-mount' read-only: Invalid argument

So instead of using mnt_fs_get_options(), we're now using both
mnt_fs_get_fs_options() and mnt_fs_get_vfs_options() and merging the
results together so we don't get any non-relevant options from fstab.

Signed-off-by: aszlig <aszlig@nix.build>
src/core/umount.c