From: Dong Hao Date: Wed, 21 Mar 2012 05:50:14 +0000 (+0800) Subject: mount: fix recursively propagation mounting X-Git-Tag: v2.22-rc1~618 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7b0af96bcd7489424ff291bbbc9d14b2dda9435;p=thirdparty%2Futil-linux.git mount: fix recursively propagation mounting 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 Signed-off-by: Dong Hao --- diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 4174f84cbf..976f459270 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -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) { diff --git a/mount/mount.c b/mount/mount.c index 2ce48293e2..396f357d91 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -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. */