]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: cosmetic changes around "none"
authorKarel Zak <kzak@redhat.com>
Fri, 2 Mar 2012 10:23:34 +0000 (11:23 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 2 Mar 2012 10:23:34 +0000 (11:23 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c
libmount/src/context_mount.c

index 1f3029202386743a1774867b5e90f503d96345ff..f97dd36a67efdf29dc1ff694903eae1c58184fb7 100644 (file)
@@ -1165,6 +1165,10 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
 
        src = mnt_fs_get_source(cxt->fs);
 
+       if (!src && (cxt->mountflags & MS_PROPAGATION))
+               /* mount --make-{shared,private,...} */
+               return mnt_fs_set_source(cxt->fs, "none");
+
        /* ignore filesystems without source or filesystems
         * where the source is quasi-path (//foo/bar)
         */
@@ -1203,7 +1207,7 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
 
        if ((cxt->mountflags & (MS_BIND | MS_MOVE | MS_PROPAGATION)) ||
            mnt_fs_is_pseudofs(cxt->fs)) {
-               DBG(CXT, mnt_debug_h(cxt, "PROPAGATION/pseudo FS source: %s", path));
+               DBG(CXT, mnt_debug_h(cxt, "BIND/MOVE/pseudo FS source: %s", path));
                return rc;
        }
 
index 098243b72e57cb0d2220d7bb24dddf01d2fc630c..c56ffd4c195ae987772f98a769d1d6d799fac3ff 100644 (file)
@@ -453,9 +453,12 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
 
        if (!target)
                return -EINVAL;
-       if (!src)
+       if (!src) {
+               /* unnecessary, should be already resolved in
+                * mnt_context_prepare_srcpath(), but for sure... */
+               DBG(CXT, mnt_debug_h(cxt, "WARNING: source is NULL -- using \"none\"!"));
                src = "none";
-
+       }
        type = try_type ? : mnt_fs_get_fstype(cxt->fs);
 
        if (!(flags & MS_MGC_MSK))