Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139537
b: refs/heads/master
c: 25fe614
h: refs/heads/master
i:
  139535: ae2eb7f
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 19, 2009
1 parent 878403f commit 2168487
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d1e8255cf959fba7ee2317550dfde39f0b936ae
refs/heads/master: 25fe6142a57c720452c5e9ddbc1f32309c1e5c19
13 changes: 11 additions & 2 deletions trunk/net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ unsigned int xprt_min_resvport = RPC_DEF_MIN_RESVPORT;
unsigned int xprt_max_resvport = RPC_DEF_MAX_RESVPORT;

#define XS_TCP_LINGER_TO (15U * HZ)
static unsigned int xs_tcp_fin_timeout __read_mostly = XS_TCP_LINGER_TO;

/*
* We can register our own files under /proc/sys/sunrpc by
Expand Down Expand Up @@ -118,6 +119,14 @@ static ctl_table xs_tunables_table[] = {
.extra1 = &xprt_min_resvport_limit,
.extra2 = &xprt_max_resvport_limit
},
{
.procname = "tcp_fin_timeout",
.data = &xs_tcp_fin_timeout,
.maxlen = sizeof(xs_tcp_fin_timeout),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
.strategy = sysctl_jiffies
},
{
.ctl_name = 0,
},
Expand Down Expand Up @@ -1222,7 +1231,7 @@ static void xs_tcp_state_change(struct sock *sk)
clear_bit(XPRT_CONNECTED, &xprt->state);
clear_bit(XPRT_CLOSE_WAIT, &xprt->state);
smp_mb__after_clear_bit();
xs_tcp_schedule_linger_timeout(xprt, XS_TCP_LINGER_TO);
xs_tcp_schedule_linger_timeout(xprt, xs_tcp_fin_timeout);
break;
case TCP_CLOSE_WAIT:
/* The server initiated a shutdown of the socket */
Expand All @@ -1239,7 +1248,7 @@ static void xs_tcp_state_change(struct sock *sk)
break;
case TCP_LAST_ACK:
set_bit(XPRT_CLOSING, &xprt->state);
xs_tcp_schedule_linger_timeout(xprt, XS_TCP_LINGER_TO);
xs_tcp_schedule_linger_timeout(xprt, xs_tcp_fin_timeout);
smp_mb__before_clear_bit();
clear_bit(XPRT_CONNECTED, &xprt->state);
smp_mb__after_clear_bit();
Expand Down

0 comments on commit 2168487

Please sign in to comment.