lkml.org 
[lkml]   [1999]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] NFS over TCP write patch ..

Hi,
Here is a patch that seems to fix the NFS over TCP write problems,
it was a problem with the way callbacks were being reset,

It also cleans out a couple of printk's not needed anymore,

There is still one bug left in the NFS over TCP stuff, which is that some
timeout occurs and the Linux client does not reconnect .. I'll keep
looking ,,

patch is against linux-2.2-pre6.

Does anyone know if this is the first Irish patch in the kernel ?

Dave.


------------ David Airlie, David.Airlie@ul.ie,airlied@skynet --------
Telecommunications Research Centre, ECE Dept, University of Limerick \
http://www.csn.ul.ie/~airlied -- Telecommunications Researcher \
--- TEL: +353-61-202695 -----------------------------------------------
Only in linux/net/sunrpc/: .depend
diff -ur linux-orig/net/sunrpc/sched.c linux/net/sunrpc/sched.c
--- linux-orig/net/sunrpc/sched.c Sun Jan 10 20:11:55 1999
+++ linux/net/sunrpc/sched.c Sun Jan 10 20:19:42 1999
@@ -5,6 +5,8 @@
*
* Copyright (C) 1996 Olaf Kirch, <okir@monad.swb.de>
*
+ * TCP NFS related read + write fixes
+ * (C) 1999 Dave Airlie, University of Limerick, Ireland <airlied@linux.ie>
*/

#include <linux/module.h>
@@ -272,8 +274,8 @@
if (task->tk_rpcwait != &schedq)
rpc_remove_wait_queue(task);
if (!RPC_IS_RUNNING(task)) {
- rpc_make_runnable(task);
task->tk_flags |= RPC_TASK_CALLBACK;
+ rpc_make_runnable(task);
}
dprintk("RPC: __rpc_wake_up done\n");
}
@@ -392,10 +394,21 @@
* Execute any pending callback.
*/
if (task->tk_flags & RPC_TASK_CALLBACK) {
+ /* Define a callback save pointer */
+ void (*save_callback)(struct rpc_task *);
+
task->tk_flags &= ~RPC_TASK_CALLBACK;
+ /*
+ * If a callback exists, save it, reset it,
+ * call it.
+ * The save is needed to stop from resetting
+ * another callback set within the callback handler
+ * - Dave
+ */
if (task->tk_callback) {
- task->tk_callback(task);
- task->tk_callback = NULL;
+ save_callback=task->tk_callback;
+ task->tk_callback=NULL;
+ save_callback(task);
}
}

diff -ur linux-orig/net/sunrpc/xprt.c linux/net/sunrpc/xprt.c
--- linux-orig/net/sunrpc/xprt.c Sun Jan 10 20:11:51 1999
+++ linux/net/sunrpc/xprt.c Sun Jan 10 20:33:25 1999
@@ -35,6 +35,8 @@
*
* TCP callback races fixes (C) 1998 Red Hat Software <alan@redhat.com>
* TCP send fixes (C) 1998 Red Hat Software <alan@redhat.com>
+ * TCP NFS related read + write fixes
+ * (C) 1999 Dave Airlie, University of Limerick, Ireland <airlied@linux.ie>
*/

#define __KERNEL_SYSCALLS__
@@ -871,14 +873,14 @@
if (!(xprt = xprt_from_sock(sk)))
return;
if(xprt->snd_sent && xprt->snd_task)
- printk("write space\n");
+ dprintk("RPC: write space\n");
if(xprt->write_space == 0)
{
xprt->write_space = 1;
if (xprt->snd_task && !RPC_IS_RUNNING(xprt->snd_task))
{
if(xprt->snd_sent)
- printk("Write wakeup snd_sent =%d\n",
+ dprintk("RPC: Write wakeup snd_sent =%d\n",
xprt->snd_sent);
rpc_wake_up_task(xprt->snd_task);
}
@@ -945,8 +947,6 @@
struct rpc_xprt *xprt = req->rq_xprt;
int status;

- /*DEBUG*/int ac_debug=xprt->snd_sent;
-
dprintk("RPC: %4d xprt_transmit(%x)\n", task->tk_pid,
*(u32 *)(req->rq_svec[0].iov_base));

@@ -994,7 +994,6 @@
xprt->snd_buf = req->rq_snd_buf;
xprt->snd_task = task;
xprt->snd_sent = 0;
- /*DEBUG*/ac_debug = 0;
}

/* For fast networks/servers we have to put the request on
@@ -1022,12 +1021,10 @@
if (xprt_transmit_some(xprt, task) != -EAGAIN) {
dprintk("RPC: %4d xmit complete\n", task->tk_pid);
xprt->snd_task = NULL;
- if(ac_debug)
- printk("Partial xmit finished\n");
return;
}

- /*d*/printk("RPC: %4d xmit incomplete (%d left of %d)\n",
+ /*d*/dprintk("RPC: %4d xmit incomplete (%d left of %d)\n",
task->tk_pid, xprt->snd_buf.io_len,
req->rq_slen);
task->tk_status = 0;
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.030 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site