linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug#669314: NFS: kernel forces trailing slash for export in /proc/self/mounts
@ 2012-06-19 19:43 Chris Hiestand
  2012-09-16  2:21 ` Ben Hutchings
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Hiestand @ 2012-06-19 19:43 UTC (permalink / raw)
  To: viro; +Cc: linux-nfs, linux-fsdevel, 669314

Hi Alexander Viro et al,

This is an escalation of Debian Bug #669314 http://bugs.debian.org/669314, which I will
re-elaborate in this email for your convenience.

You committed a change to the way the linux kernel reports NFS mounts - now with a
trailing slash for the remote export (among other changes). The change happened here:
> commit c7f404b40a3665d9f4e9a927cc5c1ee0479ed8f9
> Author: Al Viro <viro@zeniv.linux.org.uk>
> Date:   Wed Mar 16 06:59:40 2011 -0400
> 
>     vfs: new superblock methods to override /proc/*/mount{s,info}
>     
>     a) ->show_devname(m, mnt) - what to put into devname columns in mounts,
>     mountinfo and mountstats
>     b) ->show_path(m, mnt) - what to put into relative path column in mountinfo
>     
>     Leaving those NULL gives old behaviour.  NFS switched to using those.
>     
>     Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> 

The "problematic" behavior is that NFS exports now have a trailing slash in
/proc/self/mounts.

This still seems to be the case in newer kernels, for example in Debian's
3.3.2-1~experimental.1.

and HEAD in Linus Torvalds' master branch, presently commit:
02edf6abe01610a5fb379df442de3c837ad99467


I believe it is/was convention to leave a trailing slash off of the nfs export
in /etc/fstab, e.g.:
nfsserver:/srv/ubuntu-32 /mnt/ubuntu-32  nfs ro,nfsvers=3,soft,intr,tcp,nodev,noatime,nosuid,rsize=32768,wsize=32768

and I'd also expect the same in /proc/self/mounts


Expected Result:
I expect /proc/self/mounts to show (notice no trailing slash on the export):
nfsserver:/srv/ubuntu-32 /mnt/ubuntu-32 nfs ro,nosuid,nodev,noatime,vers=3,rsize=32768,wsize=32768,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=198.202.1.1,mountvers=3,mountport=41576,mountproto=tcp,local_lock=none,addr=198.202.1.1 0 0


Actual Result:
But instead in /proc/self/mounts I get (notice the trailing slash):
nfsserver:/srv/ubuntu-32/ /mnt/ubuntu-32 nfs ro,nosuid,nodev,noatime,vers=3,rsize=32768,wsize=32768,namlen=255,soft,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=198.202.1.1,mountvers=3,mountport=41576,mountproto=tcp,local_lock=none,addr=198.202.1.1 0 0


Rammifications:
This simple change has a lot of implications because lots of things parse
/etc/fstab and /proc/self/mounts, for example system configuration tools
and mount.nfs and umount.nfs.

If you use the former convention and try to umount an export on a newer
kernel it will fail:

user@hostname:/proc/self$ sudo umount.nfs nfsserver:/srv/ubuntu-32
umount.nfs: nfsserver:/srv/ubuntu-32: not found

And if you run "sudo mount -va", mount will not recognize that the fstab mounts
have already been mounted; mounting all mounts twice on the same mount point.
This quickly gets messy.

If there is a new convention to display the trailing slash, we need to update
our tools to handle this change. If there is not a new convention, I'd argue
this is a bug.

So is this a new convention or not? What is the appropriate way for Debian to move forward?

Thanks,
Chris Hiestand

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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-19 19:43 Bug#669314: NFS: kernel forces trailing slash for export in /proc/self/mounts Chris Hiestand
2012-09-16  2:21 ` Ben Hutchings
2012-09-16 10:24   ` Bug#669314: " Chris Hiestand
     [not found]     ` <254E1AAA-BDE2-41A8-94D8-6E677860AD72-xrR1t/MlNfQ@public.gmane.org>
2012-09-16 14:00       ` Ben Hutchings
     [not found]         ` <1347804028.13258.267.camel-nDn/Rdv9kqW9Jme8/bJn5UCKIB8iOfG2tUK59QYPAWc@public.gmane.org>
2012-09-16 20:41           ` Chris Hiestand
     [not found]             ` <FB3CAE84-FDFE-4345-9F54-3295BDE2AD81-xrR1t/MlNfQ@public.gmane.org>
2012-09-30 21:23               ` Jonathan Nieder
     [not found]                 ` <20120930212341.GA32505-fcEM2ccDkbL2nhBuCrrZHw@public.gmane.org>
2012-10-02 22:37                   ` Chris Hiestand
     [not found]                     ` <B259EBD8-0ED1-405F-A3E5-DF488FCE402F-xrR1t/MlNfQ@public.gmane.org>
2012-10-18 19:51                       ` Chris Hiestand
     [not found]                         ` <7941E5E1-488D-4D0B-A21A-4E389EF6EBBA-xrR1t/MlNfQ@public.gmane.org>
2012-10-21 18:23                           ` [PATCH] nfs: Show original device name verbatim in /proc/*/mount{s,info} Ben Hutchings
2012-10-22  0:01                             ` Jonathan Nieder
2012-10-31 17:45                               ` Myklebust, Trond
     [not found]                                 ` <4FA345DA4F4AE44899BD2B03EEEC2FA90929FA9E-VGJ86jkg8PeBTCzCEi1xmXOR4cbS7gtM96Bgd4bDwmQ@public.gmane.org>
2012-10-31 18:01                                   ` [PATCH v3] " Jonathan Nieder

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