From: Greg Banks <gnb@melbourne.sgi.com>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Linux NFS Mailing List <nfs@lists.sourceforge.net>
Subject: [PATCH] SGI 900985: fix nohide export option for nfsv3
Date: Fri, 03 Oct 2003 13:47:19 +1000 [thread overview]
Message-ID: <3F7CF147.B778D07B@melbourne.sgi.com> (raw)
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
next reply other threads:[~2003-10-03 3:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-03 3:47 Greg Banks [this message]
2003-10-13 6:17 ` [PATCH] SGI 900985: fix nohide export option for nfsv3 Neil Brown
2003-10-13 7:48 ` Greg Banks
2003-10-16 0:40 ` Neil Brown
2003-10-16 2:40 ` Greg Banks
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=3F7CF147.B778D07B@melbourne.sgi.com \
--to=gnb@melbourne.sgi.com \
--cc=neilb@cse.unsw.edu.au \
--cc=nfs@lists.sourceforge.net \
/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.