From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: "David S. Miller" <davem@redhat.com>
Cc: Linux Networking Development Mailing List <netdev@oss.sgi.com>
Subject: [PATCH] make sys_accept bump the net proto family module usage count
Date: Sun, 27 Apr 2003 10:56:40 -0300 [thread overview]
Message-ID: <20030427135640.GD14821@conectiva.com.br> (raw)
Hi David,
Please pull from:
bk://kernel.bkbits.net/acme/net-2.5
I'll be shortly submitting the changes for LLC and IPX, etc.
- Arnaldo
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
===================================================================
ChangeSet@1.1123, 2003-04-27 10:34:17-03:00, acme@conectiva.com.br
o net/socket: make sys_accept bump the net proto family module usage count
Thanks to Max Krasnyansky for spotting this.
socket.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff -Nru a/net/socket.c b/net/socket.c
--- a/net/socket.c Sun Apr 27 10:46:55 2003
+++ b/net/socket.c Sun Apr 27 10:46:55 2003
@@ -1288,24 +1288,28 @@
if (err)
goto out_release;
+ err = -EBUSY;
+ if (!net_family_get(sock->ops->family))
+ goto out_release;
+
err = sock->ops->accept(sock, newsock, sock->file->f_flags);
if (err < 0)
- goto out_release;
+ goto out_family_put;
if (upeer_sockaddr) {
if(newsock->ops->getname(newsock, (struct sockaddr *)address, &len, 2)<0) {
err = -ECONNABORTED;
- goto out_release;
+ goto out_family_put;
}
err = move_addr_to_user(address, len, upeer_sockaddr, upeer_addrlen);
if (err < 0)
- goto out_release;
+ goto out_family_put;
}
/* File flags are not inherited via accept() unlike another OSes. */
if ((err = sock_map_fd(newsock)) < 0)
- goto out_release;
+ goto out_family_put;
security_socket_post_accept(sock, newsock);
@@ -1313,7 +1317,8 @@
sockfd_put(sock);
out:
return err;
-
+out_family_put:
+ net_family_put(sock->ops->family);
out_release:
sock_release(newsock);
goto out_put;
===================================================================
This BitKeeper patch contains the following changesets:
1.1123
## Wrapped with gzip_uu ##
M'XL( $_?JSX ]U4VVK;0!!]UG[%E+PD%,E[T=THI+F0%K?4.,U#H6#6ZY5M
M;&F%=N76H(_O6@ZQT[H)*7VJ)#2P<SAS9N:P)W"O99TZ7!02G<![I4WJ"%5*
M819K[@E5>)/:)D9*V41OK@K9NQST2FE<Z@7(9H;<B#FL9:U3AWCL\<1L*IDZ
MHYO;^X_O1@AE&5S->3F3=]) EB&CZC5?3?4%-_.5*CU3\U(7TG0UVT=H2S&F
M]@U(Q' 0MB3$?M0*,B6$^T1.,?7CT-^S;04^Q\6P3R-LN6C0,A8E!%T#\0BA
M###K8;]'(R X97Y*(A>S%&/8CN;BUY' 6P(N1I?P;_NX0@(4V.GVM!)+:5(H
M^%*"WN@Q%T)6!B9-48&9RRT(JEH9!3DO%JL-%&K:K"0TFL\D"-64QI(!V-\7
MJV*IK53XQ'_ H.:ZW%B5RPWDJ@9=*6,6Y<RR+K2'!L!8'% TW.\+N:]\$,(<
MH_,7AK-OTQ.'\TF"J W]* I:@?.(ACP/@BB?T$0<W\5O1-V2":.A)6+4I[2S
MWR'J90>^7AR:\K4L+LK&:*]<E$ON68ZCVA@."6.D)4F"=P8,_"?VHV$:O&0_
M#&[PG_JO6]EG<.OOW6?]-'RRO;_PXP="$PP^<F1=0P;NS>7]W=<^<A8YG+ZQ
MW.-=$^.9-*?;,NZYJK1[OCL].T..,]NVJAHSKN5*<BW[Z!NZMJP,2,>^C0>H
M![ZJ,?T.%C_ X@[V)YR]ESK<+CZ'BQ]P\7-E&0EW,!LI>II/D7/0MSTXTG=_
9?\&+N11+W119/@DC$5J[_P06.[E].P8
reply other threads:[~2003-04-27 13:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030427135640.GD14821@conectiva.com.br \
--to=acme@conectiva.com.br \
--cc=davem@redhat.com \
--cc=netdev@oss.sgi.com \
/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;
as well as URLs for NNTP newsgroup(s).