]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: fix recursively propagation mounting
authorDong Hao <haodong@linux.vnet.ibm.com>
Wed, 21 Mar 2012 05:50:14 +0000 (13:50 +0800)
committerKarel Zak <kzak@redhat.com>
Wed, 21 Mar 2012 11:35:54 +0000 (12:35 +0100)
Provide the recursive flag of propagation mounting. Recursive flag could
be used together with propagation flag.

[kzak@redhat.com: - add MS_SILENT to acceptable propagation flags,
                  - fix new code in libmount too]

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Dong Hao <haodong@linux.vnet.ibm.com>
libmount/src/context_mount.c
mount/mount.c

index 4174f84cbfd338e9eb22e1c89e191e94b7861631..976f459270cc4e73ed8066c545e9951f5aca8816 100644 (file)
@@ -48,9 +48,10 @@ static int fix_optstr(struct libmnt_context *cxt)
 
        fs = cxt->fs;
 
-       /* The propagation flags should not be used together with any other flags */
+       /* The propagation flags should not be used together with any other
+        * flags (except MS_REC and MS_SILENT) */
        if (cxt->mountflags & MS_PROPAGATION)
-               cxt->mountflags &= MS_PROPAGATION;
+               cxt->mountflags &= (MS_PROPAGATION | MS_REC | MS_SILENT);
 
        if (!mnt_optstr_get_option(fs->user_optstr, "user", &val, &valsz)) {
                if (val) {
index 2ce48293e23fec6b48a6ca6484adb775806716f6..396f357d91e61ba38489c044bd5abae1c4a9f19d 100644 (file)
@@ -601,9 +601,10 @@ parse_opts (const char *options, int *flags, char **extra_opts) {
 
        *flags |= mounttype;
 
-       /* The propagation flags should not be used together with any other flags */
+       /* The propagation flags should not be used together with any
+        * other flags (except MS_REC and MS_SILENT) */
        if (*flags & MS_PROPAGATION)
-               *flags &= MS_PROPAGATION;
+               *flags &= (MS_PROPAGATION | MS_REC | MS_SILENT);
 }
 
 /* Try to build a canonical options string.  */