* NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4
@ 2007-12-07 2:20 Erez Zadok
2007-12-07 2:55 ` [NFS] " J. Bruce Fields
0 siblings, 1 reply; 7+ messages in thread
From: Erez Zadok @ 2007-12-07 2:20 UTC (permalink / raw)
To: linux-kernel, nfs
I get a "permission denied" when trying to mount a localhost nfsv2/3
exported volume, on v2.6.24-rc4-124-gf194d13. It works w/ nfsv4 mounting.
It worked fine in 2.6.24-rc3. Here's a sequence of ops I tried:
# mount -t ext2 /dev/hdb1 /n/lower/b0
# exportfs -o no_root_squash,rw localhost:/n/lower/b0
# mount -t nfs -o nfsvers=3 localhost:/n/lower/b0 /mnt
Erez.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4
2007-12-07 2:20 NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4 Erez Zadok
@ 2007-12-07 2:55 ` J. Bruce Fields
2007-12-07 20:00 ` Erez Zadok
2007-12-07 20:05 ` Erez Zadok
0 siblings, 2 replies; 7+ messages in thread
From: J. Bruce Fields @ 2007-12-07 2:55 UTC (permalink / raw)
To: Erez Zadok; +Cc: linux-kernel, nfs
On Thu, Dec 06, 2007 at 09:20:41PM -0500, Erez Zadok wrote:
> I get a "permission denied" when trying to mount a localhost nfsv2/3
> exported volume, on v2.6.24-rc4-124-gf194d13. It works w/ nfsv4 mounting.
> It worked fine in 2.6.24-rc3. Here's a sequence of ops I tried:
>
> # mount -t ext2 /dev/hdb1 /n/lower/b0
> # exportfs -o no_root_squash,rw localhost:/n/lower/b0
> # mount -t nfs -o nfsvers=3 localhost:/n/lower/b0 /mnt
What do you see if you watch the network traffic in ethereal?
--b.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4
2007-12-07 2:55 ` [NFS] " J. Bruce Fields
@ 2007-12-07 20:00 ` Erez Zadok
2007-12-07 20:06 ` J. Bruce Fields
2007-12-07 20:05 ` Erez Zadok
1 sibling, 1 reply; 7+ messages in thread
From: Erez Zadok @ 2007-12-07 20:00 UTC (permalink / raw)
To: J. Bruce Fields
Cc: Erez Zadok, linux-kernel, nfs, Eric W. Biederman,
Rafael J. Wysocki, Pavel Machek, Pavel Emelyanov,
David S. Miller, Ingo Molnar, Andrew Morton, Herbert Xu
In message <20071207025504.GA3070@fieldses.org>, "J. Bruce Fields" writes:
> On Thu, Dec 06, 2007 at 09:20:41PM -0500, Erez Zadok wrote:
> > I get a "permission denied" when trying to mount a localhost nfsv2/3
> > exported volume, on v2.6.24-rc4-124-gf194d13. It works w/ nfsv4 mounting.
> > It worked fine in 2.6.24-rc3. Here's a sequence of ops I tried:
> >
> > # mount -t ext2 /dev/hdb1 /n/lower/b0
> > # exportfs -o no_root_squash,rw localhost:/n/lower/b0
> > # mount -t nfs -o nfsvers=3 localhost:/n/lower/b0 /mnt
>
> What do you see if you watch the network traffic in ethereal?
>
> --b.
Bruce, I'm using nfs-utils-1.0.10-14.fc6 on an FC6 system with all latest
FC6 patches. Using git-bisect I was able to find the patch which broke it:
commit 2b1e300a9dfc3196ccddf6f1d74b91b7af55e416
Author: Eric W. Biederman <ebiederm@xmission.com>
Date: Sun Dec 2 00:33:17 2007 +1100
[NETNS]: Fix /proc/net breakage
Well I clearly goofed when I added the initial network namespace support
for /proc/net. Currently things work but there are odd details visible to
user space, even when we have a single network namespace.
Since we do not cache proc_dir_entry dentries at the moment we can just
modify ->lookup to return a different directory inode depending on the
network namespace of the process looking at /proc/net, replacing the
current technique of using a magic and fragile follow_link method.
To accomplish that this patch:
- introduces a shadow_proc method to allow different dentries to
be returned from proc_lookup.
- Removes the old /proc/net follow_link magic
- Fixes a weakness in our not caching of proc generic dentries.
As shadow_proc uses a task struct to decided which dentry to return we can
go back later and fix the proc generic caching without modifying any code
that uses the shadow_proc method.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
With the above patch, rpc.mountd is unable to open /proc/fs/nfsd/filehandle.
Strace shows:
open("/proc/fs/nfsd/filehandle", O_RDWR|O_LARGEFILE) = -1 ENOENT (No such file or directory)
Without the above patch, /proc/fs/nfsd is populated with a number of files,
including "filehandle".
Erez.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4
2007-12-07 2:55 ` [NFS] " J. Bruce Fields
2007-12-07 20:00 ` Erez Zadok
@ 2007-12-07 20:05 ` Erez Zadok
1 sibling, 0 replies; 7+ messages in thread
From: Erez Zadok @ 2007-12-07 20:05 UTC (permalink / raw)
To: J. Bruce Fields
Cc: Erez Zadok, linux-kernel, nfs, Eric W. Biederman, Andrew Morton
In message <20071207025504.GA3070@fieldses.org>, "J. Bruce Fields" writes:
> On Thu, Dec 06, 2007 at 09:20:41PM -0500, Erez Zadok wrote:
> > I get a "permission denied" when trying to mount a localhost nfsv2/3
> > exported volume, on v2.6.24-rc4-124-gf194d13. It works w/ nfsv4 mounting.
> > It worked fine in 2.6.24-rc3. Here's a sequence of ops I tried:
> >
> > # mount -t ext2 /dev/hdb1 /n/lower/b0
> > # exportfs -o no_root_squash,rw localhost:/n/lower/b0
> > # mount -t nfs -o nfsvers=3 localhost:/n/lower/b0 /mnt
>
> What do you see if you watch the network traffic in ethereal?
>
> --b.
Bruce, I'm using nfs-utils-1.0.10-14.fc6 on an FC6 system with all latest
FC6 patches. Using git-bisect I was able to find the patch which broke it:
commit 2b1e300a9dfc3196ccddf6f1d74b91b7af55e416
Author: Eric W. Biederman <ebiederm@xmission.com>
Date: Sun Dec 2 00:33:17 2007 +1100
[NETNS]: Fix /proc/net breakage
Well I clearly goofed when I added the initial network namespace support
for /proc/net. Currently things work but there are odd details visible to
user space, even when we have a single network namespace.
Since we do not cache proc_dir_entry dentries at the moment we can just
modify ->lookup to return a different directory inode depending on the
network namespace of the process looking at /proc/net, replacing the
current technique of using a magic and fragile follow_link method.
To accomplish that this patch:
- introduces a shadow_proc method to allow different dentries to
be returned from proc_lookup.
- Removes the old /proc/net follow_link magic
- Fixes a weakness in our not caching of proc generic dentries.
As shadow_proc uses a task struct to decided which dentry to return we can
go back later and fix the proc generic caching without modifying any code
that uses the shadow_proc method.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
With the above patch, rpc.mountd is unable to open /proc/fs/nfsd/filehandle.
Strace shows:
open("/proc/fs/nfsd/filehandle", O_RDWR|O_LARGEFILE) = -1 ENOENT (No such file or directory)
Without the above patch, /proc/fs/nfsd is populated with a number of files,
including "filehandle".
Erez.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4
2007-12-07 20:00 ` Erez Zadok
@ 2007-12-07 20:06 ` J. Bruce Fields
2007-12-07 20:32 ` Erez Zadok
2007-12-07 20:38 ` Valdis.Kletnieks
0 siblings, 2 replies; 7+ messages in thread
From: J. Bruce Fields @ 2007-12-07 20:06 UTC (permalink / raw)
To: Erez Zadok
Cc: linux-kernel, nfs, Eric W. Biederman, Rafael J. Wysocki,
Pavel Machek, Pavel Emelyanov, David S. Miller, Ingo Molnar,
Andrew Morton, Herbert Xu
On Fri, Dec 07, 2007 at 03:00:13PM -0500, Erez Zadok wrote:
> In message <20071207025504.GA3070@fieldses.org>, "J. Bruce Fields" writes:
> > On Thu, Dec 06, 2007 at 09:20:41PM -0500, Erez Zadok wrote:
> > > I get a "permission denied" when trying to mount a localhost nfsv2/3
> > > exported volume, on v2.6.24-rc4-124-gf194d13. It works w/ nfsv4 mounting.
> > > It worked fine in 2.6.24-rc3. Here's a sequence of ops I tried:
> > >
> > > # mount -t ext2 /dev/hdb1 /n/lower/b0
> > > # exportfs -o no_root_squash,rw localhost:/n/lower/b0
> > > # mount -t nfs -o nfsvers=3 localhost:/n/lower/b0 /mnt
> >
> > What do you see if you watch the network traffic in ethereal?
> >
> > --b.
>
> Bruce, I'm using nfs-utils-1.0.10-14.fc6 on an FC6 system with all latest
> FC6 patches. Using git-bisect I was able to find the patch which broke it:
Wow, thanks for your work finding that.
>
> commit 2b1e300a9dfc3196ccddf6f1d74b91b7af55e416
> Author: Eric W. Biederman <ebiederm@xmission.com>
> Date: Sun Dec 2 00:33:17 2007 +1100
>
> [NETNS]: Fix /proc/net breakage
>
> Well I clearly goofed when I added the initial network namespace support
> for /proc/net. Currently things work but there are odd details visible to
> user space, even when we have a single network namespace.
>
> Since we do not cache proc_dir_entry dentries at the moment we can just
> modify ->lookup to return a different directory inode depending on the
> network namespace of the process looking at /proc/net, replacing the
> current technique of using a magic and fragile follow_link method.
>
> To accomplish that this patch:
> - introduces a shadow_proc method to allow different dentries to
> be returned from proc_lookup.
> - Removes the old /proc/net follow_link magic
> - Fixes a weakness in our not caching of proc generic dentries.
>
> As shadow_proc uses a task struct to decided which dentry to return we can
> go back later and fix the proc generic caching without modifying any code
> that uses the shadow_proc method.
>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Pavel Emelyanov <xemul@openvz.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ingo Molnar <mingo@elte.hu>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> With the above patch, rpc.mountd is unable to open /proc/fs/nfsd/filehandle.
> Strace shows:
>
> open("/proc/fs/nfsd/filehandle", O_RDWR|O_LARGEFILE) = -1 ENOENT (No such file or directory)
>
> Without the above patch, /proc/fs/nfsd is populated with a number of files,
> including "filehandle".
Those files are actually in a separate filesystem (of type "nfsd") which
is supposed to be mounted on /proc/fs/nfsd/. So that mount must have
failed in the bad case? It's not immediately obvious to me what this
patch has to do with that. Hm.
--b.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4
2007-12-07 20:06 ` J. Bruce Fields
@ 2007-12-07 20:32 ` Erez Zadok
2007-12-07 20:38 ` Valdis.Kletnieks
1 sibling, 0 replies; 7+ messages in thread
From: Erez Zadok @ 2007-12-07 20:32 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-kernel, nfs, Eric W. Biederman, Andrew Morton
In message <20071207200655.GD2204@fieldses.org>, "J. Bruce Fields" writes:
> On Fri, Dec 07, 2007 at 03:00:13PM -0500, Erez Zadok wrote:
[...]
> Those files are actually in a separate filesystem (of type "nfsd") which
> is supposed to be mounted on /proc/fs/nfsd/. So that mount must have
> failed in the bad case? It's not immediately obvious to me what this
> patch has to do with that. Hm.
Yes, it is indeed a separate mount in both cases, but in the broken case,
/proc/fs/nfsd is empty.
The patch in question introduces a proc ->d_revalidate method which does
this:
static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd)
{
d_drop(dentry);
return 0;
}
I'm not sure why it drops the dentry and then returns OK to the VFS; is it
to force the VFS to revalidate the dentry? In that case, I think it should
return -ESTALE. I also don't know why /proc needs a ->d_revalidate in the
first place (it was fine up until now). Perhaps what proc does now is
correct, but its behavior has changed such that nfsd's /proc/fs/nfsd needs
to do something different (like grab an extra dentry ref?).
Anyway, if I comment out the d_drop line in proc_revalidate_dentry, or
remove proc's ->d_revalidate method, nfs exporting works again.
Someone more familiar with this patch and /proc should investigate. Until
then, nfsv2/3 exporting are broken in 2.6.24-rc4.
> --b.
Cheers,
Erez.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [NFS] NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4
2007-12-07 20:06 ` J. Bruce Fields
2007-12-07 20:32 ` Erez Zadok
@ 2007-12-07 20:38 ` Valdis.Kletnieks
1 sibling, 0 replies; 7+ messages in thread
From: Valdis.Kletnieks @ 2007-12-07 20:38 UTC (permalink / raw)
To: J. Bruce Fields
Cc: Erez Zadok, linux-kernel, nfs, Eric W. Biederman,
Rafael J. Wysocki, Pavel Machek, Pavel Emelyanov,
David S. Miller, Ingo Molnar, Andrew Morton, Herbert Xu
[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]
On Fri, 07 Dec 2007 15:06:55 EST, "J. Bruce Fields" said:
> On Fri, Dec 07, 2007 at 03:00:13PM -0500, Erez Zadok wrote:
> > commit 2b1e300a9dfc3196ccddf6f1d74b91b7af55e416
> > Author: Eric W. Biederman <ebiederm@xmission.com>
> > Date: Sun Dec 2 00:33:17 2007 +1100
> Those files are actually in a separate filesystem (of type "nfsd") which
> is supposed to be mounted on /proc/fs/nfsd/. So that mount must have
> failed in the bad case? It's not immediately obvious to me what this
> patch has to do with that. Hm.
For what it's worth, the startup scripts for 'wine' and 'jexec' fail as well,
and at shutdown, I get complaints about being unable to dismount
/proc/sys/fs/binfmt_misc. 'strace' says:
open("/proc/sys/fs/binfmt_misc/windows", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EN
OENT (No such file or directory)
# grep binfmt /proc/mounts
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
I have to wonder if the fact there's 2 of them mounted is related to the
fact that 2 startup scripts tried to touch files under fs/binfmt_misc/ ?
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-12-07 20:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-07 2:20 NFSv2/3 broken exporting/mounting (permission denied) in 2.6.24-rc4 Erez Zadok
2007-12-07 2:55 ` [NFS] " J. Bruce Fields
2007-12-07 20:00 ` Erez Zadok
2007-12-07 20:06 ` J. Bruce Fields
2007-12-07 20:32 ` Erez Zadok
2007-12-07 20:38 ` Valdis.Kletnieks
2007-12-07 20:05 ` Erez Zadok
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).