lkml.org 
[lkml]   [1998]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: NFS does not work


On Thu, 10 Sep 1998, Thomas Kunert wrote:

> Hi,
> I talk about a NFS connection from a linux client to an AIX-Server. NO
> special mount options. After transfering about 100MB (varies, but
> reproducable) I get a lot of `RPC: task timed out' messages and the
> transfer stops forever. There is no way to kill the offending process,
> not even `kill -9' works. SAK clears the terminal, but the process still
> stays somewhere in the background. Trying umount I get
>
> NFS: Arghhh, stuck RPC requests!
>
> and
>
> nfs_dentry_iput: pending writes for kunert/h2 i_count=1

H.J. Liu released a patch to the RPC subsystem which has yet to find its
way into the kernel sources. Give the attached a try and let all of us
know if it solves the problem?

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/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/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