util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mount: avoid canonicalizing pseudofs paths
@ 2012-01-17  1:17 Dave Reisner
  2012-01-17 10:14 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Reisner @ 2012-01-17  1:17 UTC (permalink / raw)
  To: util-linux; +Cc: Dave Reisner

This fixes a display bug in the new mount wherein a psuedofs existing in
$PWD by name will be resolved and shown as a real mount point.

  $ cd /tmp; mkdir nfsd; mount | grep nfsd
  /tmp/nfsd on /proc/fs/nfsd type nfsd (rw,relatime)

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
 sys-utils/mount.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index 81ccb41..0964828 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -146,13 +146,14 @@ static void print_all(struct libmnt_context *cxt, char *pattern, int show_label)
 		const char *type = mnt_fs_get_fstype(fs);
 		const char *src = mnt_fs_get_source(fs);
 		const char *optstr = mnt_fs_get_options(fs);
-		char *xsrc;
+		char *xsrc = NULL;
 
 		if (type && pattern && !mnt_match_fstype(type, pattern))
 			continue;
 
-		xsrc = mnt_pretty_path(src, cache);
-		printf ("%s on %s", xsrc, mnt_fs_get_target(fs));
+		if (!mnt_fs_is_pseudofs(fs))
+			xsrc = mnt_pretty_path(src, cache);
+		printf ("%s on %s", xsrc ? xsrc : src, mnt_fs_get_target(fs));
 		if (type)
 			printf (" type %s", type);
 		if (optstr)
-- 
1.7.8.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mount: avoid canonicalizing pseudofs paths
  2012-01-17  1:17 [PATCH] mount: avoid canonicalizing pseudofs paths Dave Reisner
@ 2012-01-17 10:14 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2012-01-17 10:14 UTC (permalink / raw)
  To: Dave Reisner; +Cc: util-linux, Dave Reisner

On Mon, Jan 16, 2012 at 08:17:55PM -0500, Dave Reisner wrote:
> This fixes a display bug in the new mount wherein a psuedofs existing in
> $PWD by name will be resolved and shown as a real mount point.

 Cool, we really need to test the code.

>   $ cd /tmp; mkdir nfsd; mount | grep nfsd
>   /tmp/nfsd on /proc/fs/nfsd type nfsd (rw,relatime)
> 
> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> ---
>  sys-utils/mount.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)

 Applied, thanks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-17 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17  1:17 [PATCH] mount: avoid canonicalizing pseudofs paths Dave Reisner
2012-01-17 10:14 ` Karel Zak

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).