* hi, should these code is a problem in nfs system clnt.c?
@ 2006-12-12 7:40 linuxer linuxer
2006-12-12 14:00 ` Peter Staubach
0 siblings, 1 reply; 3+ messages in thread
From: linuxer linuxer @ 2006-12-12 7:40 UTC (permalink / raw)
To: linux-kernel, torvalds, alan
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: hi, should these code is a problem in nfs system clnt.c?
2006-12-12 7:40 hi, should these code is a problem in nfs system clnt.c? linuxer linuxer
@ 2006-12-12 14:00 ` Peter Staubach
2006-12-12 16:11 ` Trond Myklebust
0 siblings, 1 reply; 3+ messages in thread
From: Peter Staubach @ 2006-12-12 14:00 UTC (permalink / raw)
To: linuxer linuxer; +Cc: linux-kernel, torvalds, alan
linuxer linuxer wrote:
> 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.
>
>
This would not be a good idea. What happens if the name of the
interface used on the system is not "eth0"?
Also, IP packets can be routed out of any available interface,
so just because one interface (eth0) is down, doesn't mean
that the entire system is networkless.
Thanx...
ps
> 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
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: hi, should these code is a problem in nfs system clnt.c?
2006-12-12 14:00 ` Peter Staubach
@ 2006-12-12 16:11 ` Trond Myklebust
0 siblings, 0 replies; 3+ messages in thread
From: Trond Myklebust @ 2006-12-12 16:11 UTC (permalink / raw)
To: Peter Staubach; +Cc: linuxer linuxer, linux-kernel, torvalds, alan
On Tue, 2006-12-12 at 09:00 -0500, Peter Staubach wrote:
> linuxer linuxer wrote:
> > 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.
> >
> >
>
> This would not be a good idea. What happens if the name of the
> interface used on the system is not "eth0"?
>
> Also, IP packets can be routed out of any available interface,
> so just because one interface (eth0) is down, doesn't mean
> that the entire system is networkless.
Right. Besides, it is also an obvious layering violation. Idea NAKed.
Trond
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-12 16:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12 7:40 hi, should these code is a problem in nfs system clnt.c? linuxer linuxer
2006-12-12 14:00 ` Peter Staubach
2006-12-12 16:11 ` Trond Myklebust
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox