util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Reisner <d@falconindy.com>
To: util-linux@vger.kernel.org
Cc: Dave Reisner <dreisner@archlinux.org>
Subject: [PATCH 2/2] libmount/context: avoid resolving pseudofs source on update
Date: Mon, 26 Dec 2011 17:10:23 -0500	[thread overview]
Message-ID: <1324937423-15766-2-git-send-email-dreisner@archlinux.org> (raw)
In-Reply-To: <1324937423-15766-1-git-send-email-dreisner@archlinux.org>

Similar to the previous commit, when mounting a pseudofs, trust the
source of the fs, as it cannot be matched to backing device on the
filesystem.

Similar situation, but slightly different bug:

  # mkdir /foo /root/foo
  # echo 'foo  /foo  tmpfs  defaults  0  0' >> /etc/fstab
  # cd /root
  # mount -a
  # mount | grep /foo
  /root/foo on /foo type tmpfs (rw,relatime)

This fixes the pure libmount based mount utility, but the legacy mount
tool will still fail to handle this properly.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
Two things:

- Since this touched a different file than the previous commit, I thought it best
to keep them separate. Karel, if you disagree, I'm happy to rebase for you.

- Legacy mount has defeated me. Uggh.

 libmount/src/context.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libmount/src/context.c b/libmount/src/context.c
index c61a144..ea372ce 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -32,6 +32,7 @@
  */
 
 #include "mountP.h"
+#include "utils.h"
 
 #include <sys/wait.h>
 
@@ -1105,7 +1106,8 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
 		/*
 		 * Source is PATH (canonicalize)
 		 */
-		path = mnt_resolve_path(src, cache);
+		if (!mnt_fstype_is_pseudofs(mnt_fs_get_fstype(cxt->fs)))
+			path = mnt_resolve_path(src, cache);
 		if (path && strcmp(path, src))
 			rc = mnt_fs_set_source(cxt->fs, path);
 	 }
-- 
1.7.8.1


  reply	other threads:[~2011-12-26 22:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-26 22:10 [PATCH 1/2] libmount/tab: always trust the source of a pseudofs Dave Reisner
2011-12-26 22:10 ` Dave Reisner [this message]
2012-01-02 14:02   ` [PATCH 2/2] libmount/context: avoid resolving pseudofs source on update Karel Zak
2011-12-26 23:47 ` [PATCH] mount: don't canonicalize the source of a pseudofs Dave Reisner
2011-12-27 11:29   ` Karel Zak
2012-01-02 14:02   ` Karel Zak
2012-01-02 14:01 ` [PATCH 1/2] libmount/tab: always trust " Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324937423-15766-2-git-send-email-dreisner@archlinux.org \
    --to=d@falconindy.com \
    --cc=dreisner@archlinux.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).