]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: improve MS_REC usage
authorKarel Zak <kzak@redhat.com>
Fri, 1 Jun 2018 10:16:19 +0000 (12:16 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 1 Jun 2018 10:16:19 +0000 (12:16 +0200)
commit816773b475900909d42c2c8282a6ac50252cac22
tree94a7673aae55f11bc0c28aa16dd393b2e4e1162a
parent4ebea84bb1ca6b0fa817588aba13de26c8d5e5a0
libmount: improve MS_REC usage

libmount allows to split one library (mount(8)) call to multiple mount(2)
syscalls, for example

   --rbind --make-rslave

in this case we have to be careful with MS_REC because the flag is
applied to multiple operations.

 # strace -e mount mount --rbind --make-rslave /mnt/A /mnt/B

Old version:

 mount("/mnt/A", "/mnt/B", 0x13ecac0, MS_MGC_VAL|MS_BIND, NULL) = 0
 mount("none", "/mnt/B", NULL, MS_REC|MS_SLAVE, NULL) = 0

Fixed version:

 mount("/mnt/A", "/mnt/B", 0x1f22ac0, MS_MGC_VAL|MS_BIND|MS_REC, NULL) = 0
 mount("none", "/mnt/B", NULL, MS_REC|MS_SLAVE, NULL) = 0

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1584443
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/context_mount.c
libmount/src/optstr.c