lkml.org 
[lkml]   [1998]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Problems building linux-nfs-0.4.22 with 2.1.117ac3


On Fri, 28 Aug 1998, Greg Whalin wrote:

> Having some problems getting the linux-nfs-0.4.22 package to build under
> 2.1.117ac3 with egcs-1.0.3a and glibc. I just wanted to make sure that I
> am doing this correctly and not making some stupid error. I spent quit a
> bit of time searching all over the net about info on this, and found very
> little. Is there a URL with a HOWTO concerning knfsd? At any rate, here
> are some of the errors I get when building.

HJ Liu was kind enough to fix this. You need to pick up:

ftp://ftp.yggdrasil.com/private/hjl/knfsd-980820.tar.gz

(or its latest successor).

It contains a corrected set of utilities and system daemons, along with a
kernel patch against 2.1.111.

A small change is required to apply against the latest kernels. For
convenience, I've attached the complete diff.

Linus: Why haven't you applied this to the source tree?

Steve

--- linux/fs/lockd/host.c.orig Wed Apr 23 22:01:26 1997
+++ linux/fs/lockd/host.c Sat Aug 22 17:54:49 1998
@@ -180,12 +180,15 @@
host->h_nextrebind - jiffies);
}
} else {
- uid_t saved_euid = current->euid;
+ uid_t saved_fsuid = current->fsuid;
+ kernel_cap_t saved_cap = current->cap_effective;

/* Create RPC socket as root user so we get a priv port */
- current->euid = 0;
+ current->fsuid = 0;
+ cap_raise (current->cap_effective, CAP_NET_BIND_SERVICE);
xprt = xprt_create_proto(host->h_proto, &host->h_addr, NULL);
- current->euid = saved_euid;
+ current->fsuid = saved_fsuid;
+ current->cap_effective = saved_cap;
if (xprt == NULL)
goto forgetit;

--- linux/include/linux/nfsd/const.h.orig Sat Aug 22 15:22:07 1998
+++ linux/include/linux/nfsd/const.h Sat Aug 22 17:54:49 1998
@@ -10,10 +10,14 @@
#define __NFSCONST_H__

#include <linux/limits.h>
+#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/dirent.h>
#include <linux/fs.h>
+#else
+#include <linux/nfs_fs.h>
+#endif
#include <linux/nfs.h>

/*
--- linux/include/linux/nfsd/export.h.orig Sat Aug 22 15:22:23 1998
+++ linux/include/linux/nfsd/export.h Sat Aug 22 17:54:49 1998
@@ -10,11 +10,6 @@
#ifndef NFSD_EXPORT_H
#define NFSD_EXPORT_H

-#include <linux/types.h>
-#include <linux/socket.h>
-#include <linux/in.h>
-#include <linux/fs.h>
-
/*
* Important limits for the exports stuff.
*/
@@ -39,6 +34,11 @@


#ifdef __KERNEL__
+
+#include <linux/types.h>
+#include <linux/socket.h>
+#include <linux/in.h>
+#include <linux/fs.h>

/* The following are hashtable sizes and must be powers of 2 */
#define NFSCLNT_EXPMAX 16
--- linux/include/linux/nfsd/nfsfh.h.orig Sat Aug 22 15:22:07 1998
+++ linux/include/linux/nfsd/nfsfh.h Sat Aug 22 17:54:49 1998
@@ -14,11 +14,17 @@
#ifndef NFSD_FH_H
#define NFSD_FH_H

+#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <linux/nfsd/const.h>
#include <linux/nfsd/debug.h>
+#else
+#include <asm/posix_types.h>
+#include <asm/types.h>
+#include <linux/nfs.h>
+#endif

/*
* This is the new "dentry style" Linux NFSv2 file handle.
--- linux/include/linux/nfsd/syscall.h.orig Sat Aug 22 15:33:05 1998
+++ linux/include/linux/nfsd/syscall.h Sat Aug 22 17:56:28 1998
@@ -9,14 +9,16 @@
#ifndef NFSD_SYSCALL_H
#define NFSD_SYSCALL_H

+#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/types.h>
#include <linux/socket.h>
+#include <linux/nfsd/auth.h>
+#endif
#include <linux/posix_types.h>
#include <linux/nfsd/const.h>
#include <linux/nfsd/export.h>
#include <linux/nfsd/nfsfh.h>
-#include <linux/nfsd/auth.h>

/*
* Version of the syscall interface
--- linux/include/linux/sunrpc/debug.h.orig Sat Aug 22 15:06:48 1998
+++ linux/include/linux/sunrpc/debug.h Sat Aug 22 17:54:49 1998
@@ -9,8 +9,10 @@
#ifndef _LINUX_SUNRPC_DEBUG_H_
#define _LINUX_SUNRPC_DEBUG_H_

+#if 0
#include <linux/timer.h>
#include <linux/tqueue.h>
+#endif

/*
* Enable RPC debugging/profiling.
--- linux/include/linux/sunrpc/sched.h.orig Sat Aug 22 15:06:48 1998
+++ linux/include/linux/sunrpc/sched.h Sat Aug 22 17:54:49 1998
@@ -128,7 +128,7 @@
void rpc_execute(struct rpc_task *);
void rpc_run_child(struct rpc_task *parent, struct rpc_task *child,
rpc_action action);
-void rpc_add_wait_queue(struct rpc_wait_queue *, struct rpc_task *);
+int rpc_add_wait_queue(struct rpc_wait_queue *, struct rpc_task *);
void rpc_remove_wait_queue(struct rpc_task *);
void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
rpc_action action, rpc_action timer);
--- linux/include/linux/quota.h.orig Fri May 8 20:54:39 1998
+++ linux/include/linux/quota.h Sat Aug 22 17:54:49 1998
@@ -39,7 +39,11 @@
#ifndef _LINUX_QUOTA_
#define _LINUX_QUOTA_

+#ifdef __KERNEL__
#include <linux/errno.h>
+#else
+#include <asm/types.h>
+#endif

/*
* Convert diskblocks to blocks and the other way around.
--- linux/include/linux/nfs_fs.h.orig Sat Aug 22 15:06:48 1998
+++ linux/include/linux/nfs_fs.h Sat Aug 22 17:54:49 1998
@@ -9,6 +9,7 @@
#ifndef _LINUX_NFS_FS_H
#define _LINUX_NFS_FS_H

+#ifdef __KERNEL__
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/in.h>
@@ -16,6 +17,7 @@
#include <linux/sunrpc/sched.h>
#include <linux/nfs.h>
#include <linux/nfs_mount.h>
+#endif

/*
* Enable debugging support for nfs client.
--- linux/include/linux/socket.h.orig Sun Aug 16 20:09:41 1998
+++ linux/include/linux/socket.h Sat Aug 22 17:54:49 1998
@@ -5,8 +5,8 @@

#include <asm/socket.h> /* arch-dependent defines */
#include <linux/sockios.h> /* the SIOCxxx I/O controls */
-#include <linux/uio.h> /* iovec support */
#include <linux/types.h> /* pid_t */
+#include <linux/uio.h> /* iovec support */

typedef unsigned short sa_family_t;

--- linux/net/sunrpc/sched.c.orig Sat Aug 22 17:50:46 1998
+++ linux/net/sunrpc/sched.c Sat Aug 22 17:54:49 1998
@@ -79,13 +79,16 @@
* improve overall performance.
* Everyone else gets appended to the queue to ensure proper FIFO behavior.
*/
-void
+int
rpc_add_wait_queue(struct rpc_wait_queue *queue, struct rpc_task *task)
{
if (task->tk_rpcwait) {
if (task->tk_rpcwait != queue)
+ {
printk(KERN_WARNING "RPC: doubly enqueued task!\n");
- return;
+ return -EWOULDBLOCK;
+ }
+ return 0;
}
if (RPC_IS_SWAPPER(task))
rpc_insert_list(&queue->task, task);
@@ -95,6 +98,8 @@

dprintk("RPC: %4d added to queue %p \"%s\"\n",
task->tk_pid, queue, rpc_qname(queue));
+
+ return 0;
}

/*
@@ -168,7 +173,13 @@
return;
}
if (RPC_IS_ASYNC(task)) {
- rpc_add_wait_queue(&schedq, task);
+ int status;
+ status = rpc_add_wait_queue(&schedq, task);
+ if (status)
+ {
+ printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status);
+ task->tk_status = status;
+ }
wake_up(&rpciod_idle);
} else {
wake_up(&task->tk_wait);
@@ -202,6 +213,7 @@
rpc_action action, rpc_action timer)
{
unsigned long oldflags;
+ int status;

dprintk("RPC: %4d sleep_on(queue \"%s\" time %ld)\n", task->tk_pid,
rpc_qname(q), jiffies);
@@ -211,11 +223,20 @@
*/
save_flags(oldflags); cli();

- rpc_add_wait_queue(q, task);
+ status = rpc_add_wait_queue(q, task);
+ if (status)
+ {
+ printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status);
+ task->tk_status = status;
+ task->tk_flags |= RPC_TASK_RUNNING;
+ }
+ else
+ {
task->tk_callback = action;
if (task->tk_timeout)
rpc_add_timer(task, timer);
task->tk_flags &= ~RPC_TASK_RUNNING;
+ }

restore_flags(oldflags);
return;
--- linux/net/sunrpc/xprt.c.orig Sat Aug 22 17:50:46 1998
+++ linux/net/sunrpc/xprt.c Sat Aug 22 17:54:49 1998
@@ -935,6 +935,7 @@
struct rpc_timeout *timeo;
struct rpc_rqst *req = task->tk_rqstp;
struct rpc_xprt *xprt = req->rq_xprt;
+ int status;

/*DEBUG*/int ac_debug=xprt->snd_sent;

@@ -992,9 +993,17 @@
* the pending list now:
*/
start_bh_atomic();
- rpc_add_wait_queue(&xprt->pending, task);
+ status = rpc_add_wait_queue(&xprt->pending, task);
+ if (!status)
task->tk_callback = NULL;
end_bh_atomic();
+
+ if (status)
+ {
+ printk(KERN_WARNING "RPC: failed to add task to queue: error: %d!\n", status);
+ task->tk_status = status;
+ return;
+ }

/* Continue transmitting the packet/record. We must be careful
* to cope with writespace callbacks arriving _after_ we have
\
 
 \ /
  Last update: 2005-03-22 13:44    [from the cache]
©2003-2011 Jasper Spaans