1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-29 01:49:55 +03:00

mount-util: don't mask away MS_RDONLY twice

We have the flags mask for that, and if callers really wanted us to mask
this away, then they should pass the correct mask.
This commit is contained in:
Lennart Poettering
2020-01-09 14:55:15 +01:00
parent f3dab34d22
commit 4eaf0d9401

View File

@ -237,7 +237,6 @@ int bind_remount_recursive_with_mountinfo(
orig_flags = 0;
(void) get_mount_flags(simplified, &orig_flags, table);
orig_flags &= ~MS_RDONLY;
if (mount(NULL, simplified, NULL, (orig_flags & ~flags_mask)|MS_BIND|MS_REMOUNT|new_flags, NULL) < 0)
return -errno;
@ -279,7 +278,6 @@ int bind_remount_recursive_with_mountinfo(
/* Try to reuse the original flag set */
orig_flags = 0;
(void) get_mount_flags(x, &orig_flags, table);
orig_flags &= ~MS_RDONLY;
if (mount(NULL, x, NULL, (orig_flags & ~flags_mask)|MS_BIND|MS_REMOUNT|new_flags, NULL) < 0)
return -errno;