rpms/kernel/FC-4 kernel-2.6.spec, 1.1405, 1.1406 linux-2.6.12-nfsd-ctlbits.patch, 1.1, 1.2

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Aug 3 22:02:58 UTC 2005


Author: davej

Update of /cvs/dist/rpms/kernel/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv4542

Modified Files:
	kernel-2.6.spec linux-2.6.12-nfsd-ctlbits.patch 
Log Message:
Further NFSD fixing for non-standard ports.



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-4/kernel-2.6.spec,v
retrieving revision 1.1405
retrieving revision 1.1406
diff -u -r1.1405 -r1.1406
--- kernel-2.6.spec	3 Aug 2005 21:32:14 -0000	1.1405
+++ kernel-2.6.spec	3 Aug 2005 22:02:36 -0000	1.1406
@@ -1279,6 +1279,7 @@
 - Silence some messages from PowerMac thermal driver. (#158739)
 - nfs server intermitently claimed ENOENT on existing files or directories. (#150759)
 - Stop usbhid driver incorrectly claiming Wireless Security Lock as a mouse. (#147479)
+- Further NFSD fixing for non-standard ports.
 
 * Fri Jul 29 2005 Dave Jones <davej at redhat.com>
 - Include backport of 2.6.13rc4 ACPI (acpi-20050708-2.6.12.patch)

linux-2.6.12-nfsd-ctlbits.patch:
 fs/nfsd/nfs4state.c          |    3 +
 fs/nfsd/nfsctl.c             |  111 ++++++++++++++++++++++++++++++++++++++++++-
 fs/nfsd/nfssvc.c             |   92 +++++++++++++++++++++++------------
 include/linux/nfsd/syscall.h |   19 +++++++
 4 files changed, 192 insertions(+), 33 deletions(-)

Index: linux-2.6.12-nfsd-ctlbits.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-4/linux-2.6.12-nfsd-ctlbits.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6.12-nfsd-ctlbits.patch	12 Jul 2005 20:49:09 -0000	1.1
+++ linux-2.6.12-nfsd-ctlbits.patch	3 Aug 2005 22:02:37 -0000	1.2
@@ -1,11 +1,5 @@
-This kernel patch allows the setting of the port and network transport
-on which kNFSD will listen on and which protocol version will
-be advertised. 
-
-Signed-off: Steve Dickson <steved at redhat.com>
--------------------------------
 --- linux-2.6.12/fs/nfsd/nfs4state.c.orig	2005-06-17 15:48:29.000000000 -0400
-+++ linux-2.6.12/fs/nfsd/nfs4state.c	2005-07-11 07:57:11.000000000 -0400
++++ linux-2.6.12/fs/nfsd/nfs4state.c	2005-07-25 13:18:04.000000000 -0400
 @@ -3256,6 +3256,9 @@ __nfs4_state_shutdown(void)
  void
  nfs4_state_shutdown(void)
@@ -17,7 +11,7 @@
  	nfs4_release_reclaim();
  	__nfs4_state_shutdown();
 --- linux-2.6.12/fs/nfsd/nfsctl.c.orig	2005-06-17 15:48:29.000000000 -0400
-+++ linux-2.6.12/fs/nfsd/nfsctl.c	2005-07-11 13:59:46.000000000 -0400
++++ linux-2.6.12/fs/nfsd/nfsctl.c	2005-07-26 06:58:54.000000000 -0400
 @@ -23,6 +23,7 @@
  #include <linux/seq_file.h>
  #include <linux/pagemap.h>
@@ -64,22 +58,7 @@
  };
  
  static ssize_t nfsctl_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos)
-@@ -85,14 +96,12 @@ static ssize_t nfsctl_transaction_write(
- 	ino_t ino =  file->f_dentry->d_inode->i_ino;
- 	char *data;
- 	ssize_t rv;
--
- 	if (ino >= sizeof(write_op)/sizeof(write_op[0]) || !write_op[ino])
- 		return -EINVAL;
- 
- 	data = simple_transaction_get(file, buf, size);
- 	if (IS_ERR(data))
- 		return PTR_ERR(data);
--
- 	rv =  write_op[ino](file, data, size);
- 	if (rv>0) {
- 		simple_transaction_set(file, rv);
-@@ -256,7 +265,7 @@ static ssize_t write_filehandle(struct f
+@@ -256,7 +267,7 @@ static ssize_t write_filehandle(struct f
  	 * qword quoting is used, so filehandle will be \x....
  	 */
  	char *dname, *path;
@@ -88,7 +67,7 @@
  	char *mesg = buf;
  	int len;
  	struct auth_domain *dom;
-@@ -325,6 +334,92 @@ static ssize_t write_threads(struct file
+@@ -325,6 +336,102 @@ static ssize_t write_threads(struct file
  	sprintf(buf, "%d\n", nfsd_nrthreads());
  	return strlen(buf);
  }
@@ -96,10 +75,10 @@
 +{
 +	/*
 +	 * Format:
-+	 *   family proto address port
++	 *   family proto proto address port
 +	 */
 +	char *mesg = buf;
-+	char *family, *proto, *addr; 
++	char *family, *udp, *tcp, *addr; 
 +	int len, port = 0;
 +	ssize_t tlen = 0;
 +
@@ -112,12 +91,17 @@
 +	if (len <= 0) return -EINVAL;
 +
 +	tlen += len;
-+	proto = family+len+1;
-+	len = qword_get(&mesg, proto, size);
++	udp = family+len+1;
++	len = qword_get(&mesg, udp, size);
++	if (len <= 0) return -EINVAL;
++
++	tlen += len;
++	tcp = udp+len+1;
++	len = qword_get(&mesg, tcp, size);
 +	if (len <= 0) return -EINVAL;
 +
 +	tlen += len;
-+	addr = proto+len+1;
++	addr = tcp+len+1;
 +	len = qword_get(&mesg, addr, size);
 +	if (len <= 0) return -EINVAL;
 +
@@ -129,10 +113,15 @@
 +	if (port)
 +		nfsd_port = port;
 +
-+	if (strcmp(proto, "tcp") == 0 || strcmp(proto, "TCP") == 0)
++	if (strcmp(tcp, "tcp") == 0 || strcmp(tcp, "TCP") == 0)
 +		NFSCTL_TCPSET(nfsd_portbits);
-+	if (strcmp(proto, "udp") == 0 || strcmp(proto, "UDP") == 0)
++	else
++		NFSCTL_TCPUNSET(nfsd_portbits);
++
++	if (strcmp(udp, "udp") == 0 || strcmp(udp, "UDP") == 0)
 +		NFSCTL_UDPSET(nfsd_portbits);
++	else
++		NFSCTL_UDPUNSET(nfsd_portbits);
 +
 +	return tlen;
 +}
@@ -181,7 +170,7 @@
  
  extern time_t nfs4_leasetime(void);
  
-@@ -370,6 +465,8 @@ static int nfsd_fill_super(struct super_
+@@ -370,6 +477,8 @@ static int nfsd_fill_super(struct super_
  #ifdef CONFIG_NFSD_V4
  		[NFSD_Leasetime] = {"nfsv4leasetime", &transaction_ops, S_IWUSR|S_IRUSR},
  #endif
@@ -191,7 +180,7 @@
  	};
  	return simple_fill_super(sb, 0x6e667364, nfsd_files);
 --- linux-2.6.12/fs/nfsd/nfssvc.c.orig	2005-06-17 15:48:29.000000000 -0400
-+++ linux-2.6.12/fs/nfsd/nfssvc.c	2005-07-11 11:36:04.000000000 -0400
++++ linux-2.6.12/fs/nfsd/nfssvc.c	2005-07-25 13:18:04.000000000 -0400
 @@ -30,6 +30,7 @@
  #include <linux/nfsd/nfsd.h>
  #include <linux/nfsd/stats.h>
@@ -200,19 +189,7 @@
  #include <linux/lockd/bind.h>
  
  #define NFSDDBG_FACILITY	NFSDDBG_SVC
-@@ -51,10 +52,7 @@
- extern struct svc_program	nfsd_program;
- static void			nfsd(struct svc_rqst *rqstp);
- struct timeval			nfssvc_boot;
--static struct svc_serv 		*nfsd_serv;
--static atomic_t			nfsd_busy;
--static unsigned long		nfsd_last_call;
--static DEFINE_SPINLOCK(nfsd_call_lock);
-+static struct svc_serv 		*nfsd_serv; static atomic_t			nfsd_busy; static unsigned long		nfsd_last_call; static DEFINE_SPINLOCK(nfsd_call_lock);
- 
- struct nfsd_list {
- 	struct list_head 	list;
-@@ -62,6 +60,31 @@ struct nfsd_list {
+@@ -62,6 +63,33 @@ struct nfsd_list {
  };
  static struct list_head nfsd_list = LIST_HEAD_INIT(nfsd_list);
  
@@ -230,10 +207,12 @@
 +
 +#define NFSD_MINVERS    	2
 +#define NFSD_NRVERS		(sizeof(nfsd_version)/sizeof(nfsd_version[0]))
++static struct svc_version *nfsd_versions[NFSD_NRVERS];
++
 +struct svc_program		nfsd_program = {
 +	.pg_prog		= NFS_PROGRAM,		/* program number */
 +	.pg_nvers		= NFSD_NRVERS,		/* nr of entries in nfsd_version */
-+	.pg_vers		= nfsd_version,		/* version table */
++	.pg_vers		= nfsd_versions,	/* version table */
 +	.pg_name		= "nfsd",		/* program name */
 +	.pg_class		= "nfsd",		/* authentication class */
 +	.pg_stats		= &nfsd_svcstats,	/* version table */
@@ -244,12 +223,12 @@
  /*
   * Maximum number of nfsd processes
   */
-@@ -79,17 +102,37 @@ int
+@@ -79,16 +107,36 @@ int
  nfsd_svc(unsigned short port, int nrservs)
  {
  	int	error;
 -	int	none_left;	
-+	int	none_left, found_one, i;
++	int	none_left, found_one, i;	
  	struct list_head *victim;
  	
  	lock_kernel();
@@ -261,7 +240,7 @@
  		nrservs = 0;
  	if (nrservs > NFSD_MAXSERVS)
  		nrservs = NFSD_MAXSERVS;
- 	
++
 +	/*
 +	 * If set, use the nfsd_ctlbits to define which
 +	 * versions that will be advertised
@@ -280,18 +259,10 @@
 +		for (i = NFSD_MINVERS; i < NFSD_NRVERS; i++)
 +			nfsd_program.pg_vers[i] = nfsd_version[i];
 +	}
-+
+ 	
  	/* Readahead param cache - will no-op if it already exists */
  	error =	nfsd_racache_init(2*nrservs);
- 	if (error<0)
-@@ -97,20 +140,24 @@ nfsd_svc(unsigned short port, int nrserv
- 	error = nfs4_state_init();
- 	if (error<0)
- 		goto out;
-+
- 	if (!nfsd_serv) {
- 		atomic_set(&nfsd_busy, 0);
- 		error = -ENOMEM;
+@@ -103,14 +151,17 @@ nfsd_svc(unsigned short port, int nrserv
  		nfsd_serv = svc_create(&nfsd_program, NFSD_BUFSIZE);
  		if (nfsd_serv == NULL)
  			goto out;
@@ -316,7 +287,7 @@
  #endif
  		do_gettimeofday(&nfssvc_boot);		/* record boot time */
  	} else
-@@ -362,26 +409,3 @@ nfsd_dispatch(struct svc_rqst *rqstp, u3
+@@ -362,26 +413,3 @@ nfsd_dispatch(struct svc_rqst *rqstp, u3
  	return 1;
  }
  
@@ -344,7 +315,7 @@
 -
 -};
 --- linux-2.6.12/include/linux/nfsd/syscall.h.orig	2005-06-17 15:48:29.000000000 -0400
-+++ linux-2.6.12/include/linux/nfsd/syscall.h	2005-07-11 11:31:21.000000000 -0400
++++ linux-2.6.12/include/linux/nfsd/syscall.h	2005-07-25 13:18:04.000000000 -0400
 @@ -39,6 +39,22 @@
  #define NFSCTL_GETFD		7	/* get an fh by path (used by mountd) */
  #define	NFSCTL_GETFS		8	/* get an fh by path with max FH len */
@@ -378,4 +349,3 @@
  #endif /* __KERNEL__ */
  
  #endif /* NFSD_SYSCALL_H */
-




More information about the fedora-cvs-commits mailing list