]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: keep MS_PROPAGATION flags in mnt_context_set_mflags() result
authorKarel Zak <kzak@redhat.com>
Tue, 15 Jan 2013 15:08:41 +0000 (16:08 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 15 Jan 2013 15:08:41 +0000 (16:08 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c

index 2e28d650a8505bb9f7f53f1e84cec70d7fc64a5b..6d57038349aad589598a0e0e307146d59fce0c48 100644 (file)
@@ -1212,6 +1212,8 @@ int mnt_context_set_mflags(struct libmnt_context *cxt, unsigned long flags)
 int mnt_context_get_mflags(struct libmnt_context *cxt, unsigned long *flags)
 {
        int rc = 0;
+       struct list_head *p;
+
        if (!cxt || !flags)
                return -EINVAL;
 
@@ -1222,6 +1224,14 @@ int mnt_context_get_mflags(struct libmnt_context *cxt, unsigned long *flags)
                        rc = mnt_optstr_get_flags(o, flags,
                                    mnt_get_builtin_optmap(MNT_LINUX_MAP));
        }
+
+       list_for_each(p, &cxt->addmounts) {
+               struct libmnt_addmount *ad =
+                               list_entry(p, struct libmnt_addmount, mounts);
+
+               *flags |= ad->mountflags;
+       }
+
        if (!rc)
                *flags |= cxt->mountflags;
        return rc;