All of lore.kernel.org
 help / color / mirror / Atom feed
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: Re: [PATCH] SGI 907674: document fsid export option
Date: Fri, 27 Feb 2004 22:37:41 +1100	[thread overview]
Message-ID: <403F2C05.EF210E45@melbourne.sgi.com> (raw)
In-Reply-To: 16444.5325.978979.117912@notabene.cse.unsw.edu.au

Neil Brown wrote:
> 
> On Wednesday February 25, gnb@melbourne.sgi.com wrote:
> > Neil Brown wrote:
> >
> > > This interface is not needed in 2.6 and will be going away in 2.7, and
> > > the new interface (via text written into /proc ) doesn't have the 16
> > > bit limit.
> > >
> > > I think we should document it as a 32bit number, but note that only 16
> > > bits are significant in certain situations.
> >
> > >From my reading of nfs-utils last night it seems it still gets truncated
> > even with the new interface, because a struct nfsctl_export is used as
> > temporary storage.
> 
> Hmm.  That can and should be fixed.  I will look at it.



This patch against nfs-utils 1.0.6 enables 32 bit fsid when the new
/proc/fs/nfsd interface is being used.  It even works with fsid > 2^31
(although both the kernel and nfs-utils print such fsids as negative,
they do work).

I have a much larger and uglier patch which enables 32 bit fsid on
2.4 kernels and the 2.6 kernels using nfsservctl(), which does work
but I believe risks compatibility issues.  I won't post it.



diff -Napur --exclude-from=excludes
nfs-utils-sgi/nfs-utils-1.0.6/support/include/nfs/nfs.h
nfs-utils-work/nfs-utils-1.0.6/support/include/nfs/nfs.h
--- nfs-utils-sgi/nfs-utils-1.0.6/support/include/nfs/nfs.h	Wed Feb 25 20:43:02 2004
+++ nfs-utils-work/nfs-utils-1.0.6/support/include/nfs/nfs.h	Fri Feb 27 21:49:58 2004
@@ -71,7 +71,8 @@ struct nfsctl_client {
 #endif
 
 /* EXPORT/UNEXPORT */
-struct nfsctl_export {
+/* kernel's version */
+struct nfsctl_kexport {
 	char			ex_client[NFSCLNT_IDMAX+1];
 	char			ex_path[NFS_MAXPATHLEN+1];
 	__nfsd_dev_t		ex_dev;
@@ -80,6 +81,18 @@ struct nfsctl_export {
 	__kernel_uid_t		ex_anon_uid;
 	__kernel_gid_t		ex_anon_gid;
 };
+/* userspace version with 32bit ex_dev/fsid field */
+struct nfsctl_export {
+	char			ex_client[NFSCLNT_IDMAX+1];
+	char			ex_path[NFS_MAXPATHLEN+1];
+	__nfsd_dev_t		ex_unused1;
+	__kernel_ino_t		ex_ino;
+	int			ex_flags;
+	__kernel_uid_t		ex_anon_uid;
+	__kernel_gid_t		ex_anon_gid;
+
+	uint32_t		ex_dev;
+};
 
 /* UGIDUPDATE */
 struct nfsctl_uidmap {
@@ -128,7 +141,7 @@ struct nfsctl_arg {
 	union {
 		struct nfsctl_svc	u_svc;
 		struct nfsctl_client	u_client;
-		struct nfsctl_export	u_export;
+		struct nfsctl_kexport	u_export;
 		struct nfsctl_uidmap	u_umap;
 		struct nfsctl_fhparm	u_getfh;
 		struct nfsctl_fdparm	u_getfd;
diff -Napur --exclude-from=excludes
nfs-utils-sgi/nfs-utils-1.0.6/support/nfs/nfsexport.c
nfs-utils-work/nfs-utils-1.0.6/support/nfs/nfsexport.c
--- nfs-utils-sgi/nfs-utils-1.0.6/support/nfs/nfsexport.c	Fri Aug  1 13:42:04 2003
+++ nfs-utils-work/nfs-utils-1.0.6/support/nfs/nfsexport.c	Fri Feb 27 21:50:43 2004
@@ -99,6 +99,7 @@ nfsexport(struct nfsctl_export *exp)
 	}
 	arg.ca_version = NFSCTL_VERSION;
 	memcpy(&arg.ca_export, exp, sizeof(arg.ca_export));
+	arg.ca_export.ex_dev = (__nfsd_dev_t)exp->ex_dev;
 	return nfsctl(NFSCTL_EXPORT, &arg, NULL);
 }
 
@@ -115,5 +116,6 @@ nfsunexport(struct nfsctl_export *exp)
 
 	arg.ca_version = NFSCTL_VERSION;
 	memcpy(&arg.ca_export, exp, sizeof(arg.ca_export));
+	arg.ca_export.ex_dev = (__nfsd_dev_t)exp->ex_dev;
 	return nfsctl(NFSCTL_UNEXPORT, &arg, NULL);
 }



Greg.
-- 
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

      parent reply	other threads:[~2004-02-27 11:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-29  3:48 [PATCH] SGI 907674: document fsid export option Greg Banks
2004-01-29 23:45 ` Greg Banks
2004-02-24  3:39 ` Neil Brown
2004-02-24  4:07   ` Greg Banks
2004-02-24  4:10     ` Neil Brown
2004-02-24  4:31       ` Greg Banks
2004-02-25  0:04         ` Neil Brown
2004-02-25  0:31           ` Greg Banks
2004-02-25  3:21             ` Neil Brown
2004-02-25  4:39               ` Greg Banks
2004-02-27 11:37               ` Greg Banks [this message]

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=403F2C05.EF210E45@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.