All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Luk Claes <luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: slash appended to filesystem when mtab symlinked to proc
Date: Tue, 5 Apr 2011 08:51:47 -0700	[thread overview]
Message-ID: <20110405085147.22dc6829@corrin.poochiereds.net> (raw)
In-Reply-To: <4D99D6A1.7080101-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>

On Mon, 04 Apr 2011 16:33:05 +0200
Luk Claes <luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org> wrote:

> Hi
> 
> A Debian user reported a bug that a slash gets appended to the
> filesystem when he mounts a share. This only happens when mtab is
> symlinked to proc which I can reproduce:
> 
> $ grep cifs /etc/fstab
> //<host>/<path>	/mnt	cifs	user,user=<username>	0	0
> 
> $ mount /mnt
> 
> $ grep cifs /etc/mtab
> //<host>/<path>/ /mnt cifs
> rw,nosuid,nodev,relatime,unc=\\<host>\<path>,username=<username>,uid=1000,forceuid,gid=1000,forcegid,addr=<ip>,file_mode=0755,dir_mode=0755,serverino,rsize=16384,wsize=57344
> 0 0
> 
> $ umount /mnt
> umount: /mnt mount disagrees with the fstab
> 
> There does not seem to be any other filesystems that append a slash to
> the filesystem in proc. Does cifsfs do that intentionally (in which case
> the client should cope with it: by means of umount.cifs?) or should it
> get fixed in the kernel (maybe the client should still cope with it)?
> 
> Can you give me a hand in identifying the code that would need to be
> updated to fix this so I can prepare a patch?
> 
> Cheers
> 
> Luk

mount.cifs will convert the delimiters in the "device string" to
forward slashes (in case someone specifies a UNC with backslashes) and
then passes it down to the kernel. When it does this, it adds an
unnecessary '/' to the end. Probably what we need to do is make it pass
down the "original" device string to the kernel mount() call.

The reason mount.cifs does this though is because /proc/mounts turns
'\\' into an escaped number string. So, in addition to changing
mount.cifs to fix this, the kernel routines that format /proc/mounts
should also be fixed to handle backslashes correctly.

Cheers,
-- 
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

  parent reply	other threads:[~2011-04-05 15:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 14:33 slash appended to filesystem when mtab symlinked to proc Luk Claes
     [not found] ` <4D99D6A1.7080101-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2011-04-05 15:51   ` Jeff Layton [this message]
     [not found]     ` <20110405085147.22dc6829-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-04-05 22:26       ` [PATCH] mount.cifs: only convert '\' to '/' for dev_name Luk Claes
     [not found]         ` <1302042408-10579-1-git-send-email-luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2011-04-05 23:06           ` Jeff Layton
     [not found]             ` <20110405160636.1e956ecf-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-04-06  8:46               ` [PATCH] mount.cifs: Use original device string all the way Luk Claes
     [not found]                 ` <1302079615-14411-1-git-send-email-luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2011-04-08 18:14                   ` Jeff Layton

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=20110405085147.22dc6829@corrin.poochiereds.net \
    --to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=luk-8fiUuRrzOP0dnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.