public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: linuxer linuxer <tangzt@yahoo.com>
To: linux-kernel@vger.kernel.org, torvalds@osdl.org, alan@redhat.com
Subject: hi, should these code is a problem in nfs system clnt.c?
Date: Mon, 11 Dec 2006 23:40:16 -0800 (PST)	[thread overview]
Message-ID: <319714.29242.qm@web36002.mail.mud.yahoo.com> (raw)

Hi, everyone: 
    I am a newbie, if my question waste your time, I
am sorry for that. 

    In clnt.c file ,call_timeout function:    
    I suggest the code that judge whether the network
link status is down should be added, won't they? 
    I tested it with one Ethernet netcard.

static void
call_timeout(struct rpc_task *task)
{
	struct rpc_clnt	*clnt = task->tk_client;

+       struct netdev * dev;
+       if ((dev = __dev_get_by_name("eth0")) == 
+        NULL){
+		rpc_exit(task, -ENOTCONN);
+		return;
+    	}
+	else{
+   		 if (!netif_carrier_ok(dev)){
+  			rpc_exit(task, -ENOTCONN);
+			return;
+  		 }
+     	}

	if (xprt_adjust_timeout(task->tk_rqstp) == 0) {
		dprintk("RPC: %4d call_timeout (minor)\n",
task->tk_pid);
		goto retry;
	}

	dprintk("RPC: %4d call_timeout (major)\n",
task->tk_pid);
	task->tk_timeouts++;

	if (RPC_IS_SOFT(task)) {
		printk(KERN_NOTICE "%s: server %s not responding,
timed out\n",
				clnt->cl_protname, clnt->cl_server);
		rpc_exit(task, -EIO);
		return;
	}

	if (!(task->tk_flags & RPC_CALL_MAJORSEEN)) {
		task->tk_flags |= RPC_CALL_MAJORSEEN;
		printk(KERN_NOTICE "%s: server %s not responding,
still trying\n",
			clnt->cl_protname, clnt->cl_server);
	}
	rpc_force_rebind(clnt);

retry:
	clnt->cl_stats->rpcretrans++;
	task->tk_action = call_bind;
	task->tk_status = 0;
}



 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

             reply	other threads:[~2006-12-12  7:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12  7:40 linuxer linuxer [this message]
2006-12-12 14:00 ` hi, should these code is a problem in nfs system clnt.c? Peter Staubach
2006-12-12 16:11   ` Trond Myklebust

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=319714.29242.qm@web36002.mail.mud.yahoo.com \
    --to=tangzt@yahoo.com \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox