* [PATCH] SGI 900985: fix nohide export option for nfsv3
@ 2003-10-03 3:47 Greg Banks
2003-10-13 6:17 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Greg Banks @ 2003-10-03 3:47 UTC (permalink / raw)
To: Neil Brown; +Cc: Linux NFS Mailing List
G'day,
SGI bug 900985.
The "nohide" export option fails over NFSv3 because the client gets
as a side effect of READDIRPLUS file handles for server-side mountpoints
which haven't gone through the nohide logic in LOOKUP and thus refer
to the underlying directory instead the covering one.
This patch fixes that by changing the XDR encode for the READDIRPLUS
reply to send no file handle if the directory's child is a mountpoint.
The protocol says the filehandle is optional in the READDIRPLUS reply.
If the client has a client-side mountpoint matching the server-side
mountpoint, it will get the file handle of the mountpoint's covering
directory by traversing the client-side mountpoint. Otherwise, the
client will issue a LOOKUP which will return either the underlying or
covering directories as per the normal nohide logic.
This is on-the-wire identical to how IRIX deals with the issue, as can
be easily demonstrated by sniffing NFS traffic to an IRIX box with a
nohide export.
Tested on Linux 2.4.21 servers with Linux 2.4 and IRIX clients. The
patch is against 2.4 but the same bug exists in 2.6 and the same patch
should fix it (untested).
--- /usr/tmp/TmpDir.24872-0/linux/linux/fs/nfsd/nfs3xdr.c_1.23 Fri Sep 19 20:12:50
2003
+++ linux/linux/fs/nfsd/nfs3xdr.c Fri Sep 19 20:09:25 2003
@@ -721,6 +721,8 @@
dchild = lookup_one_len(name, dparent,namlen);
if (IS_ERR(dchild))
goto noexec;
+ if (d_mountpoint(dchild))
+ goto noexec;
if (fh_compose(&fh, exp, dchild, cd->dirfh) != 0 || !dchild->d_inode)
goto noexec;
p = encode_post_op_attr(cd->rqstp, p, &fh);
--- /usr/tmp/TmpDir.24872-0/linux/linux/fs/nfsd/vfs.c_1.47 Fri Sep 19 20:12:50 2003
+++ linux/linux/fs/nfsd/vfs.c Fri Sep 19 20:08:03 2003
@@ -86,7 +86,7 @@
* accepted as it stands and the mounted directory is
* returned. Otherwise the covered directory is returned.
* NOTE: this mountpoint crossing is not supported properly by all
- * clients and is explicitly disallowed for NFSv3
+ * clients.
* NeilBrown <neilb@cse.unsw.edu.au>
*/
int
Greg.
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] SGI 900985: fix nohide export option for nfsv3
2003-10-03 3:47 [PATCH] SGI 900985: fix nohide export option for nfsv3 Greg Banks
@ 2003-10-13 6:17 ` Neil Brown
2003-10-13 7:48 ` Greg Banks
0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2003-10-13 6:17 UTC (permalink / raw)
To: Greg Banks; +Cc: Linux NFS Mailing List
On Friday October 3, gnb@melbourne.sgi.com wrote:
> G'day,
>
> SGI bug 900985.
>
> The "nohide" export option fails over NFSv3 because the client gets
> as a side effect of READDIRPLUS file handles for server-side mountpoints
> which haven't gone through the nohide logic in LOOKUP and thus refer
> to the underlying directory instead the covering one.
...
>
>
> --- /usr/tmp/TmpDir.24872-0/linux/linux/fs/nfsd/nfs3xdr.c_1.23 Fri Sep 19 20:12:50
> 2003
> +++ linux/linux/fs/nfsd/nfs3xdr.c Fri Sep 19 20:09:25 2003
> @@ -721,6 +721,8 @@
> dchild = lookup_one_len(name, dparent,namlen);
> if (IS_ERR(dchild))
> goto noexec;
> + if (d_mountpoint(dchild))
> + goto noexec;
> if (fh_compose(&fh, exp, dchild, cd->dirfh) != 0 || !dchild->d_inode)
> goto noexec;
> p = encode_post_op_attr(cd->rqstp, p, &fh);
>
This looks OK. Thanks.
> --- /usr/tmp/TmpDir.24872-0/linux/linux/fs/nfsd/vfs.c_1.47 Fri Sep 19 20:12:50 2003
> +++ linux/linux/fs/nfsd/vfs.c Fri Sep 19 20:08:03 2003
> @@ -86,7 +86,7 @@
> * accepted as it stands and the mounted directory is
> * returned. Otherwise the covered directory is returned.
> * NOTE: this mountpoint crossing is not supported properly by all
> - * clients and is explicitly disallowed for NFSv3
> + * clients.
> * NeilBrown <neilb@cse.unsw.edu.au>
This isn't quite right. What the comment *Should* say is:
... and RFC1813 explicitly dis-allows it for NFSv3 (See section 3.3.3).
NeilBrown
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] SGI 900985: fix nohide export option for nfsv3
2003-10-13 6:17 ` Neil Brown
@ 2003-10-13 7:48 ` Greg Banks
2003-10-16 0:40 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Greg Banks @ 2003-10-13 7:48 UTC (permalink / raw)
To: Neil Brown; +Cc: Linux NFS Mailing List
Neil Brown wrote:
>
> On Friday October 3, gnb@melbourne.sgi.com wrote:
> > G'day,
> >
> > --- /usr/tmp/TmpDir.24872-0/linux/linux/fs/nfsd/vfs.c_1.47 Fri Sep 19 20:12:50 2003
> > +++ linux/linux/fs/nfsd/vfs.c Fri Sep 19 20:08:03 2003
> > @@ -86,7 +86,7 @@
> > * accepted as it stands and the mounted directory is
> > * returned. Otherwise the covered directory is returned.
> > * NOTE: this mountpoint crossing is not supported properly by all
> > - * clients and is explicitly disallowed for NFSv3
> > + * clients.
> > * NeilBrown <neilb@cse.unsw.edu.au>
>
> This isn't quite right. What the comment *Should* say is:
> ... and RFC1813 explicitly dis-allows it for NFSv3 (See section 3.3.3).
RFC1813 section 3.3.3 says...
> A server will not allow a LOOKUP operation to cross a mountpoint
> to the root of a different filesystem, even if the filesystem is
> exported.
> [...]
> A given server implementation may refine these rules given
> capabilities or limitations particular to that implementation.
> Refer to [X/OpenNFS] for a discussion on exporting file systems.
Reads to me like there's a loophole designed specifically for the
nohide option.
The thing is, we have customers moving from Irix systems with an "sgi"
logo on the front to Linux systems with an "sgi" logo on the front; they
see the "nohide" option like they're used to and (poor naive creatures)
expect it to work. Having it work on v2 and silently fail on v3 is
really submarvellous.
Greg.
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] SGI 900985: fix nohide export option for nfsv3
2003-10-13 7:48 ` Greg Banks
@ 2003-10-16 0:40 ` Neil Brown
2003-10-16 2:40 ` Greg Banks
0 siblings, 1 reply; 5+ messages in thread
From: Neil Brown @ 2003-10-16 0:40 UTC (permalink / raw)
To: Greg Banks; +Cc: Linux NFS Mailing List
On Monday October 13, gnb@melbourne.sgi.com wrote:
> Neil Brown wrote:
> >
> > On Friday October 3, gnb@melbourne.sgi.com wrote:
> > > G'day,
> > >
> > > --- /usr/tmp/TmpDir.24872-0/linux/linux/fs/nfsd/vfs.c_1.47 Fri Sep 19 20:12:50 2003
> > > +++ linux/linux/fs/nfsd/vfs.c Fri Sep 19 20:08:03 2003
> > > @@ -86,7 +86,7 @@
> > > * accepted as it stands and the mounted directory is
> > > * returned. Otherwise the covered directory is returned.
> > > * NOTE: this mountpoint crossing is not supported properly by all
> > > - * clients and is explicitly disallowed for NFSv3
> > > + * clients.
> > > * NeilBrown <neilb@cse.unsw.edu.au>
> >
> > This isn't quite right. What the comment *Should* say is:
> > ... and RFC1813 explicitly dis-allows it for NFSv3 (See section 3.3.3).
>
> RFC1813 section 3.3.3 says...
>
> > A server will not allow a LOOKUP operation to cross a mountpoint
> > to the root of a different filesystem, even if the filesystem is
> > exported.
> > [...]
> > A given server implementation may refine these rules given
> > capabilities or limitations particular to that implementation.
> > Refer to [X/OpenNFS] for a discussion on exporting file systems.
>
> Reads to me like there's a loophole designed specifically for the
> nohide option.
So it does. I guess I never read that far, and mistakenly read
"A server will not allow..." as "A server SHALL not allow..." :-)
>
> The thing is, we have customers moving from Irix systems with an "sgi"
> logo on the front to Linux systems with an "sgi" logo on the front; they
> see the "nohide" option like they're used to and (poor naive creatures)
> expect it to work. Having it work on v2 and silently fail on v3 is
> really submarvellous.
Certainly there is no suggestion of not supporting it for V3. The
comment was just meant to say that we weren't allowed to support it,
but that we didn't.
NeilBrown
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] SGI 900985: fix nohide export option for nfsv3
2003-10-16 0:40 ` Neil Brown
@ 2003-10-16 2:40 ` Greg Banks
0 siblings, 0 replies; 5+ messages in thread
From: Greg Banks @ 2003-10-16 2:40 UTC (permalink / raw)
To: Neil Brown; +Cc: Linux NFS Mailing List
Neil Brown wrote:
>
> On Monday October 13, gnb@melbourne.sgi.com wrote:
> > The thing is, [...] Having it work on v2 and silently fail on v3 is
> > really submarvellous.
>
> Certainly there is no suggestion of not supporting it for V3.
Sorry, I missed your "Ok, thanks" for the first part of the diff.
Greg.
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-10-16 2:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-03 3:47 [PATCH] SGI 900985: fix nohide export option for nfsv3 Greg Banks
2003-10-13 6:17 ` Neil Brown
2003-10-13 7:48 ` Greg Banks
2003-10-16 0:40 ` Neil Brown
2003-10-16 2:40 ` Greg Banks
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.