diff options
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 107 |
1 files changed, 57 insertions, 50 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 49cabffd7fdb..64736b3a59a7 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -192,7 +192,7 @@ static void xs_pktdump(char *msg, u32 *packet, unsigned int count) | |||
192 | u8 *buf = (u8 *) packet; | 192 | u8 *buf = (u8 *) packet; |
193 | int j; | 193 | int j; |
194 | 194 | ||
195 | dprintk("RPC: %s\n", msg); | 195 | dprintk("RPC: %s\n", msg); |
196 | for (j = 0; j < count && j < 128; j += 4) { | 196 | for (j = 0; j < count && j < 128; j += 4) { |
197 | if (!(j & 31)) { | 197 | if (!(j & 31)) { |
198 | if (j) | 198 | if (j) |
@@ -418,7 +418,7 @@ static void xs_nospace(struct rpc_task *task) | |||
418 | struct rpc_xprt *xprt = req->rq_xprt; | 418 | struct rpc_xprt *xprt = req->rq_xprt; |
419 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 419 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
420 | 420 | ||
421 | dprintk("RPC: %4d xmit incomplete (%u left of %u)\n", | 421 | dprintk("RPC: %5u xmit incomplete (%u left of %u)\n", |
422 | task->tk_pid, req->rq_slen - req->rq_bytes_sent, | 422 | task->tk_pid, req->rq_slen - req->rq_bytes_sent, |
423 | req->rq_slen); | 423 | req->rq_slen); |
424 | 424 | ||
@@ -467,7 +467,7 @@ static int xs_udp_send_request(struct rpc_task *task) | |||
467 | xprt->addrlen, xdr, | 467 | xprt->addrlen, xdr, |
468 | req->rq_bytes_sent); | 468 | req->rq_bytes_sent); |
469 | 469 | ||
470 | dprintk("RPC: xs_udp_send_request(%u) = %d\n", | 470 | dprintk("RPC: xs_udp_send_request(%u) = %d\n", |
471 | xdr->len - req->rq_bytes_sent, status); | 471 | xdr->len - req->rq_bytes_sent, status); |
472 | 472 | ||
473 | if (likely(status >= (int) req->rq_slen)) | 473 | if (likely(status >= (int) req->rq_slen)) |
@@ -488,7 +488,7 @@ static int xs_udp_send_request(struct rpc_task *task) | |||
488 | xs_nospace(task); | 488 | xs_nospace(task); |
489 | break; | 489 | break; |
490 | default: | 490 | default: |
491 | dprintk("RPC: sendmsg returned unrecognized error %d\n", | 491 | dprintk("RPC: sendmsg returned unrecognized error %d\n", |
492 | -status); | 492 | -status); |
493 | break; | 493 | break; |
494 | } | 494 | } |
@@ -539,7 +539,7 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
539 | status = xs_sendpages(transport->sock, | 539 | status = xs_sendpages(transport->sock, |
540 | NULL, 0, xdr, req->rq_bytes_sent); | 540 | NULL, 0, xdr, req->rq_bytes_sent); |
541 | 541 | ||
542 | dprintk("RPC: xs_tcp_send_request(%u) = %d\n", | 542 | dprintk("RPC: xs_tcp_send_request(%u) = %d\n", |
543 | xdr->len - req->rq_bytes_sent, status); | 543 | xdr->len - req->rq_bytes_sent, status); |
544 | 544 | ||
545 | if (unlikely(status < 0)) | 545 | if (unlikely(status < 0)) |
@@ -570,7 +570,7 @@ static int xs_tcp_send_request(struct rpc_task *task) | |||
570 | status = -ENOTCONN; | 570 | status = -ENOTCONN; |
571 | break; | 571 | break; |
572 | default: | 572 | default: |
573 | dprintk("RPC: sendmsg returned unrecognized error %d\n", | 573 | dprintk("RPC: sendmsg returned unrecognized error %d\n", |
574 | -status); | 574 | -status); |
575 | xprt_disconnect(xprt); | 575 | xprt_disconnect(xprt); |
576 | break; | 576 | break; |
@@ -622,7 +622,7 @@ static void xs_close(struct rpc_xprt *xprt) | |||
622 | if (!sk) | 622 | if (!sk) |
623 | goto clear_close_wait; | 623 | goto clear_close_wait; |
624 | 624 | ||
625 | dprintk("RPC: xs_close xprt %p\n", xprt); | 625 | dprintk("RPC: xs_close xprt %p\n", xprt); |
626 | 626 | ||
627 | write_lock_bh(&sk->sk_callback_lock); | 627 | write_lock_bh(&sk->sk_callback_lock); |
628 | transport->inet = NULL; | 628 | transport->inet = NULL; |
@@ -652,7 +652,7 @@ static void xs_destroy(struct rpc_xprt *xprt) | |||
652 | { | 652 | { |
653 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 653 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
654 | 654 | ||
655 | dprintk("RPC: xs_destroy xprt %p\n", xprt); | 655 | dprintk("RPC: xs_destroy xprt %p\n", xprt); |
656 | 656 | ||
657 | cancel_delayed_work(&transport->connect_worker); | 657 | cancel_delayed_work(&transport->connect_worker); |
658 | flush_scheduled_work(); | 658 | flush_scheduled_work(); |
@@ -686,7 +686,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) | |||
686 | __be32 *xp; | 686 | __be32 *xp; |
687 | 687 | ||
688 | read_lock(&sk->sk_callback_lock); | 688 | read_lock(&sk->sk_callback_lock); |
689 | dprintk("RPC: xs_udp_data_ready...\n"); | 689 | dprintk("RPC: xs_udp_data_ready...\n"); |
690 | if (!(xprt = xprt_from_sock(sk))) | 690 | if (!(xprt = xprt_from_sock(sk))) |
691 | goto out; | 691 | goto out; |
692 | 692 | ||
@@ -698,7 +698,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) | |||
698 | 698 | ||
699 | repsize = skb->len - sizeof(struct udphdr); | 699 | repsize = skb->len - sizeof(struct udphdr); |
700 | if (repsize < 4) { | 700 | if (repsize < 4) { |
701 | dprintk("RPC: impossible RPC reply size %d!\n", repsize); | 701 | dprintk("RPC: impossible RPC reply size %d!\n", repsize); |
702 | goto dropit; | 702 | goto dropit; |
703 | } | 703 | } |
704 | 704 | ||
@@ -762,11 +762,11 @@ static inline void xs_tcp_read_fraghdr(struct rpc_xprt *xprt, struct xdr_skb_rea | |||
762 | 762 | ||
763 | /* Sanity check of the record length */ | 763 | /* Sanity check of the record length */ |
764 | if (unlikely(transport->tcp_reclen < 4)) { | 764 | if (unlikely(transport->tcp_reclen < 4)) { |
765 | dprintk("RPC: invalid TCP record fragment length\n"); | 765 | dprintk("RPC: invalid TCP record fragment length\n"); |
766 | xprt_disconnect(xprt); | 766 | xprt_disconnect(xprt); |
767 | return; | 767 | return; |
768 | } | 768 | } |
769 | dprintk("RPC: reading TCP record fragment of length %d\n", | 769 | dprintk("RPC: reading TCP record fragment of length %d\n", |
770 | transport->tcp_reclen); | 770 | transport->tcp_reclen); |
771 | } | 771 | } |
772 | 772 | ||
@@ -789,7 +789,7 @@ static inline void xs_tcp_read_xid(struct sock_xprt *transport, struct xdr_skb_r | |||
789 | char *p; | 789 | char *p; |
790 | 790 | ||
791 | len = sizeof(transport->tcp_xid) - transport->tcp_offset; | 791 | len = sizeof(transport->tcp_xid) - transport->tcp_offset; |
792 | dprintk("RPC: reading XID (%Zu bytes)\n", len); | 792 | dprintk("RPC: reading XID (%Zu bytes)\n", len); |
793 | p = ((char *) &transport->tcp_xid) + transport->tcp_offset; | 793 | p = ((char *) &transport->tcp_xid) + transport->tcp_offset; |
794 | used = xdr_skb_read_bits(desc, p, len); | 794 | used = xdr_skb_read_bits(desc, p, len); |
795 | transport->tcp_offset += used; | 795 | transport->tcp_offset += used; |
@@ -798,7 +798,7 @@ static inline void xs_tcp_read_xid(struct sock_xprt *transport, struct xdr_skb_r | |||
798 | transport->tcp_flags &= ~TCP_RCV_COPY_XID; | 798 | transport->tcp_flags &= ~TCP_RCV_COPY_XID; |
799 | transport->tcp_flags |= TCP_RCV_COPY_DATA; | 799 | transport->tcp_flags |= TCP_RCV_COPY_DATA; |
800 | transport->tcp_copied = 4; | 800 | transport->tcp_copied = 4; |
801 | dprintk("RPC: reading reply for XID %08x\n", | 801 | dprintk("RPC: reading reply for XID %08x\n", |
802 | ntohl(transport->tcp_xid)); | 802 | ntohl(transport->tcp_xid)); |
803 | xs_tcp_check_fraghdr(transport); | 803 | xs_tcp_check_fraghdr(transport); |
804 | } | 804 | } |
@@ -816,7 +816,7 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_rea | |||
816 | req = xprt_lookup_rqst(xprt, transport->tcp_xid); | 816 | req = xprt_lookup_rqst(xprt, transport->tcp_xid); |
817 | if (!req) { | 817 | if (!req) { |
818 | transport->tcp_flags &= ~TCP_RCV_COPY_DATA; | 818 | transport->tcp_flags &= ~TCP_RCV_COPY_DATA; |
819 | dprintk("RPC: XID %08x request not found!\n", | 819 | dprintk("RPC: XID %08x request not found!\n", |
820 | ntohl(transport->tcp_xid)); | 820 | ntohl(transport->tcp_xid)); |
821 | spin_unlock(&xprt->transport_lock); | 821 | spin_unlock(&xprt->transport_lock); |
822 | return; | 822 | return; |
@@ -853,19 +853,20 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_rea | |||
853 | * be discarded. | 853 | * be discarded. |
854 | */ | 854 | */ |
855 | transport->tcp_flags &= ~TCP_RCV_COPY_DATA; | 855 | transport->tcp_flags &= ~TCP_RCV_COPY_DATA; |
856 | dprintk("RPC: XID %08x truncated request\n", | 856 | dprintk("RPC: XID %08x truncated request\n", |
857 | ntohl(transport->tcp_xid)); | 857 | ntohl(transport->tcp_xid)); |
858 | dprintk("RPC: xprt = %p, tcp_copied = %lu, tcp_offset = %u, tcp_reclen = %u\n", | 858 | dprintk("RPC: xprt = %p, tcp_copied = %lu, " |
859 | xprt, transport->tcp_copied, transport->tcp_offset, | 859 | "tcp_offset = %u, tcp_reclen = %u\n", |
860 | transport->tcp_reclen); | 860 | xprt, transport->tcp_copied, |
861 | transport->tcp_offset, transport->tcp_reclen); | ||
861 | goto out; | 862 | goto out; |
862 | } | 863 | } |
863 | 864 | ||
864 | dprintk("RPC: XID %08x read %Zd bytes\n", | 865 | dprintk("RPC: XID %08x read %Zd bytes\n", |
865 | ntohl(transport->tcp_xid), r); | 866 | ntohl(transport->tcp_xid), r); |
866 | dprintk("RPC: xprt = %p, tcp_copied = %lu, tcp_offset = %u, tcp_reclen = %u\n", | 867 | dprintk("RPC: xprt = %p, tcp_copied = %lu, tcp_offset = %u, " |
867 | xprt, transport->tcp_copied, transport->tcp_offset, | 868 | "tcp_reclen = %u\n", xprt, transport->tcp_copied, |
868 | transport->tcp_reclen); | 869 | transport->tcp_offset, transport->tcp_reclen); |
869 | 870 | ||
870 | if (transport->tcp_copied == req->rq_private_buf.buflen) | 871 | if (transport->tcp_copied == req->rq_private_buf.buflen) |
871 | transport->tcp_flags &= ~TCP_RCV_COPY_DATA; | 872 | transport->tcp_flags &= ~TCP_RCV_COPY_DATA; |
@@ -891,7 +892,7 @@ static inline void xs_tcp_read_discard(struct sock_xprt *transport, struct xdr_s | |||
891 | desc->count -= len; | 892 | desc->count -= len; |
892 | desc->offset += len; | 893 | desc->offset += len; |
893 | transport->tcp_offset += len; | 894 | transport->tcp_offset += len; |
894 | dprintk("RPC: discarded %Zu bytes\n", len); | 895 | dprintk("RPC: discarded %Zu bytes\n", len); |
895 | xs_tcp_check_fraghdr(transport); | 896 | xs_tcp_check_fraghdr(transport); |
896 | } | 897 | } |
897 | 898 | ||
@@ -905,7 +906,7 @@ static int xs_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, uns | |||
905 | .count = len, | 906 | .count = len, |
906 | }; | 907 | }; |
907 | 908 | ||
908 | dprintk("RPC: xs_tcp_data_recv started\n"); | 909 | dprintk("RPC: xs_tcp_data_recv started\n"); |
909 | do { | 910 | do { |
910 | /* Read in a new fragment marker if necessary */ | 911 | /* Read in a new fragment marker if necessary */ |
911 | /* Can we ever really expect to get completely empty fragments? */ | 912 | /* Can we ever really expect to get completely empty fragments? */ |
@@ -926,7 +927,7 @@ static int xs_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, uns | |||
926 | /* Skip over any trailing bytes on short reads */ | 927 | /* Skip over any trailing bytes on short reads */ |
927 | xs_tcp_read_discard(transport, &desc); | 928 | xs_tcp_read_discard(transport, &desc); |
928 | } while (desc.count); | 929 | } while (desc.count); |
929 | dprintk("RPC: xs_tcp_data_recv done\n"); | 930 | dprintk("RPC: xs_tcp_data_recv done\n"); |
930 | return len - desc.count; | 931 | return len - desc.count; |
931 | } | 932 | } |
932 | 933 | ||
@@ -941,8 +942,9 @@ static void xs_tcp_data_ready(struct sock *sk, int bytes) | |||
941 | struct rpc_xprt *xprt; | 942 | struct rpc_xprt *xprt; |
942 | read_descriptor_t rd_desc; | 943 | read_descriptor_t rd_desc; |
943 | 944 | ||
945 | dprintk("RPC: xs_tcp_data_ready...\n"); | ||
946 | |||
944 | read_lock(&sk->sk_callback_lock); | 947 | read_lock(&sk->sk_callback_lock); |
945 | dprintk("RPC: xs_tcp_data_ready...\n"); | ||
946 | if (!(xprt = xprt_from_sock(sk))) | 948 | if (!(xprt = xprt_from_sock(sk))) |
947 | goto out; | 949 | goto out; |
948 | if (xprt->shutdown) | 950 | if (xprt->shutdown) |
@@ -968,11 +970,11 @@ static void xs_tcp_state_change(struct sock *sk) | |||
968 | read_lock(&sk->sk_callback_lock); | 970 | read_lock(&sk->sk_callback_lock); |
969 | if (!(xprt = xprt_from_sock(sk))) | 971 | if (!(xprt = xprt_from_sock(sk))) |
970 | goto out; | 972 | goto out; |
971 | dprintk("RPC: xs_tcp_state_change client %p...\n", xprt); | 973 | dprintk("RPC: xs_tcp_state_change client %p...\n", xprt); |
972 | dprintk("RPC: state %x conn %d dead %d zapped %d\n", | 974 | dprintk("RPC: state %x conn %d dead %d zapped %d\n", |
973 | sk->sk_state, xprt_connected(xprt), | 975 | sk->sk_state, xprt_connected(xprt), |
974 | sock_flag(sk, SOCK_DEAD), | 976 | sock_flag(sk, SOCK_DEAD), |
975 | sock_flag(sk, SOCK_ZAPPED)); | 977 | sock_flag(sk, SOCK_ZAPPED)); |
976 | 978 | ||
977 | switch (sk->sk_state) { | 979 | switch (sk->sk_state) { |
978 | case TCP_ESTABLISHED: | 980 | case TCP_ESTABLISHED: |
@@ -1140,7 +1142,7 @@ static void xs_set_port(struct rpc_xprt *xprt, unsigned short port) | |||
1140 | { | 1142 | { |
1141 | struct sockaddr_in *sap = (struct sockaddr_in *) &xprt->addr; | 1143 | struct sockaddr_in *sap = (struct sockaddr_in *) &xprt->addr; |
1142 | 1144 | ||
1143 | dprintk("RPC: setting port for xprt %p to %u\n", xprt, port); | 1145 | dprintk("RPC: setting port for xprt %p to %u\n", xprt, port); |
1144 | 1146 | ||
1145 | sap->sin_port = htons(port); | 1147 | sap->sin_port = htons(port); |
1146 | } | 1148 | } |
@@ -1159,7 +1161,7 @@ static int xs_bindresvport(struct sock_xprt *transport, struct socket *sock) | |||
1159 | sizeof(myaddr)); | 1161 | sizeof(myaddr)); |
1160 | if (err == 0) { | 1162 | if (err == 0) { |
1161 | transport->port = port; | 1163 | transport->port = port; |
1162 | dprintk("RPC: xs_bindresvport bound to port %u\n", | 1164 | dprintk("RPC: xs_bindresvport bound to port %u\n", |
1163 | port); | 1165 | port); |
1164 | return 0; | 1166 | return 0; |
1165 | } | 1167 | } |
@@ -1169,7 +1171,7 @@ static int xs_bindresvport(struct sock_xprt *transport, struct socket *sock) | |||
1169 | port--; | 1171 | port--; |
1170 | } while (err == -EADDRINUSE && port != transport->port); | 1172 | } while (err == -EADDRINUSE && port != transport->port); |
1171 | 1173 | ||
1172 | dprintk("RPC: can't bind to reserved port (%d).\n", -err); | 1174 | dprintk("RPC: can't bind to reserved port (%d).\n", -err); |
1173 | return err; | 1175 | return err; |
1174 | } | 1176 | } |
1175 | 1177 | ||
@@ -1223,7 +1225,7 @@ static void xs_udp_connect_worker(struct work_struct *work) | |||
1223 | xs_close(xprt); | 1225 | xs_close(xprt); |
1224 | 1226 | ||
1225 | if ((err = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock)) < 0) { | 1227 | if ((err = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock)) < 0) { |
1226 | dprintk("RPC: can't create UDP transport socket (%d).\n", -err); | 1228 | dprintk("RPC: can't create UDP transport socket (%d).\n", -err); |
1227 | goto out; | 1229 | goto out; |
1228 | } | 1230 | } |
1229 | xs_reclassify_socket(sock); | 1231 | xs_reclassify_socket(sock); |
@@ -1233,7 +1235,7 @@ static void xs_udp_connect_worker(struct work_struct *work) | |||
1233 | goto out; | 1235 | goto out; |
1234 | } | 1236 | } |
1235 | 1237 | ||
1236 | dprintk("RPC: worker connecting xprt %p to address: %s\n", | 1238 | dprintk("RPC: worker connecting xprt %p to address: %s\n", |
1237 | xprt, xprt->address_strings[RPC_DISPLAY_ALL]); | 1239 | xprt, xprt->address_strings[RPC_DISPLAY_ALL]); |
1238 | 1240 | ||
1239 | if (!transport->inet) { | 1241 | if (!transport->inet) { |
@@ -1275,7 +1277,7 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt) | |||
1275 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 1277 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
1276 | struct sockaddr any; | 1278 | struct sockaddr any; |
1277 | 1279 | ||
1278 | dprintk("RPC: disconnecting xprt %p to reuse port\n", xprt); | 1280 | dprintk("RPC: disconnecting xprt %p to reuse port\n", xprt); |
1279 | 1281 | ||
1280 | /* | 1282 | /* |
1281 | * Disconnect the transport socket by doing a connect operation | 1283 | * Disconnect the transport socket by doing a connect operation |
@@ -1285,7 +1287,7 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt) | |||
1285 | any.sa_family = AF_UNSPEC; | 1287 | any.sa_family = AF_UNSPEC; |
1286 | result = kernel_connect(transport->sock, &any, sizeof(any), 0); | 1288 | result = kernel_connect(transport->sock, &any, sizeof(any), 0); |
1287 | if (result) | 1289 | if (result) |
1288 | dprintk("RPC: AF_UNSPEC connect return code %d\n", | 1290 | dprintk("RPC: AF_UNSPEC connect return code %d\n", |
1289 | result); | 1291 | result); |
1290 | } | 1292 | } |
1291 | 1293 | ||
@@ -1309,7 +1311,8 @@ static void xs_tcp_connect_worker(struct work_struct *work) | |||
1309 | if (!sock) { | 1311 | if (!sock) { |
1310 | /* start from scratch */ | 1312 | /* start from scratch */ |
1311 | if ((err = sock_create_kern(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock)) < 0) { | 1313 | if ((err = sock_create_kern(PF_INET, SOCK_STREAM, IPPROTO_TCP, &sock)) < 0) { |
1312 | dprintk("RPC: can't create TCP transport socket (%d).\n", -err); | 1314 | dprintk("RPC: can't create TCP transport " |
1315 | "socket (%d).\n", -err); | ||
1313 | goto out; | 1316 | goto out; |
1314 | } | 1317 | } |
1315 | xs_reclassify_socket(sock); | 1318 | xs_reclassify_socket(sock); |
@@ -1322,7 +1325,7 @@ static void xs_tcp_connect_worker(struct work_struct *work) | |||
1322 | /* "close" the socket, preserving the local port */ | 1325 | /* "close" the socket, preserving the local port */ |
1323 | xs_tcp_reuse_connection(xprt); | 1326 | xs_tcp_reuse_connection(xprt); |
1324 | 1327 | ||
1325 | dprintk("RPC: worker connecting xprt %p to address: %s\n", | 1328 | dprintk("RPC: worker connecting xprt %p to address: %s\n", |
1326 | xprt, xprt->address_strings[RPC_DISPLAY_ALL]); | 1329 | xprt, xprt->address_strings[RPC_DISPLAY_ALL]); |
1327 | 1330 | ||
1328 | if (!transport->inet) { | 1331 | if (!transport->inet) { |
@@ -1359,8 +1362,9 @@ static void xs_tcp_connect_worker(struct work_struct *work) | |||
1359 | xprt->stat.connect_start = jiffies; | 1362 | xprt->stat.connect_start = jiffies; |
1360 | status = kernel_connect(sock, (struct sockaddr *) &xprt->addr, | 1363 | status = kernel_connect(sock, (struct sockaddr *) &xprt->addr, |
1361 | xprt->addrlen, O_NONBLOCK); | 1364 | xprt->addrlen, O_NONBLOCK); |
1362 | dprintk("RPC: %p connect status %d connected %d sock state %d\n", | 1365 | dprintk("RPC: %p connect status %d connected %d sock state %d\n", |
1363 | xprt, -status, xprt_connected(xprt), sock->sk->sk_state); | 1366 | xprt, -status, xprt_connected(xprt), |
1367 | sock->sk->sk_state); | ||
1364 | if (status < 0) { | 1368 | if (status < 0) { |
1365 | switch (status) { | 1369 | switch (status) { |
1366 | case -EINPROGRESS: | 1370 | case -EINPROGRESS: |
@@ -1404,7 +1408,8 @@ static void xs_connect(struct rpc_task *task) | |||
1404 | return; | 1408 | return; |
1405 | 1409 | ||
1406 | if (transport->sock != NULL) { | 1410 | if (transport->sock != NULL) { |
1407 | dprintk("RPC: xs_connect delayed xprt %p for %lu seconds\n", | 1411 | dprintk("RPC: xs_connect delayed xprt %p for %lu " |
1412 | "seconds\n", | ||
1408 | xprt, xprt->reestablish_timeout / HZ); | 1413 | xprt, xprt->reestablish_timeout / HZ); |
1409 | schedule_delayed_work(&transport->connect_worker, | 1414 | schedule_delayed_work(&transport->connect_worker, |
1410 | xprt->reestablish_timeout); | 1415 | xprt->reestablish_timeout); |
@@ -1412,7 +1417,7 @@ static void xs_connect(struct rpc_task *task) | |||
1412 | if (xprt->reestablish_timeout > XS_TCP_MAX_REEST_TO) | 1417 | if (xprt->reestablish_timeout > XS_TCP_MAX_REEST_TO) |
1413 | xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO; | 1418 | xprt->reestablish_timeout = XS_TCP_MAX_REEST_TO; |
1414 | } else { | 1419 | } else { |
1415 | dprintk("RPC: xs_connect scheduled xprt %p\n", xprt); | 1420 | dprintk("RPC: xs_connect scheduled xprt %p\n", xprt); |
1416 | schedule_delayed_work(&transport->connect_worker, 0); | 1421 | schedule_delayed_work(&transport->connect_worker, 0); |
1417 | 1422 | ||
1418 | /* flush_scheduled_work can sleep... */ | 1423 | /* flush_scheduled_work can sleep... */ |
@@ -1507,13 +1512,14 @@ static struct rpc_xprt *xs_setup_xprt(struct sockaddr *addr, size_t addrlen, uns | |||
1507 | struct sock_xprt *new; | 1512 | struct sock_xprt *new; |
1508 | 1513 | ||
1509 | if (addrlen > sizeof(xprt->addr)) { | 1514 | if (addrlen > sizeof(xprt->addr)) { |
1510 | dprintk("RPC: xs_setup_xprt: address too large\n"); | 1515 | dprintk("RPC: xs_setup_xprt: address too large\n"); |
1511 | return ERR_PTR(-EBADF); | 1516 | return ERR_PTR(-EBADF); |
1512 | } | 1517 | } |
1513 | 1518 | ||
1514 | new = kzalloc(sizeof(*new), GFP_KERNEL); | 1519 | new = kzalloc(sizeof(*new), GFP_KERNEL); |
1515 | if (new == NULL) { | 1520 | if (new == NULL) { |
1516 | dprintk("RPC: xs_setup_xprt: couldn't allocate rpc_xprt\n"); | 1521 | dprintk("RPC: xs_setup_xprt: couldn't allocate " |
1522 | "rpc_xprt\n"); | ||
1517 | return ERR_PTR(-ENOMEM); | 1523 | return ERR_PTR(-ENOMEM); |
1518 | } | 1524 | } |
1519 | xprt = &new->xprt; | 1525 | xprt = &new->xprt; |
@@ -1522,7 +1528,8 @@ static struct rpc_xprt *xs_setup_xprt(struct sockaddr *addr, size_t addrlen, uns | |||
1522 | xprt->slot = kcalloc(xprt->max_reqs, sizeof(struct rpc_rqst), GFP_KERNEL); | 1528 | xprt->slot = kcalloc(xprt->max_reqs, sizeof(struct rpc_rqst), GFP_KERNEL); |
1523 | if (xprt->slot == NULL) { | 1529 | if (xprt->slot == NULL) { |
1524 | kfree(xprt); | 1530 | kfree(xprt); |
1525 | dprintk("RPC: xs_setup_xprt: couldn't allocate slot table\n"); | 1531 | dprintk("RPC: xs_setup_xprt: couldn't allocate slot " |
1532 | "table\n"); | ||
1526 | return ERR_PTR(-ENOMEM); | 1533 | return ERR_PTR(-ENOMEM); |
1527 | } | 1534 | } |
1528 | 1535 | ||
@@ -1572,7 +1579,7 @@ struct rpc_xprt *xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_ | |||
1572 | xprt_set_timeout(&xprt->timeout, 5, 5 * HZ); | 1579 | xprt_set_timeout(&xprt->timeout, 5, 5 * HZ); |
1573 | 1580 | ||
1574 | xs_format_peer_addresses(xprt); | 1581 | xs_format_peer_addresses(xprt); |
1575 | dprintk("RPC: set up transport to address %s\n", | 1582 | dprintk("RPC: set up transport to address %s\n", |
1576 | xprt->address_strings[RPC_DISPLAY_ALL]); | 1583 | xprt->address_strings[RPC_DISPLAY_ALL]); |
1577 | 1584 | ||
1578 | return xprt; | 1585 | return xprt; |
@@ -1616,7 +1623,7 @@ struct rpc_xprt *xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_ | |||
1616 | xprt_set_timeout(&xprt->timeout, 2, 60 * HZ); | 1623 | xprt_set_timeout(&xprt->timeout, 2, 60 * HZ); |
1617 | 1624 | ||
1618 | xs_format_peer_addresses(xprt); | 1625 | xs_format_peer_addresses(xprt); |
1619 | dprintk("RPC: set up transport to address %s\n", | 1626 | dprintk("RPC: set up transport to address %s\n", |
1620 | xprt->address_strings[RPC_DISPLAY_ALL]); | 1627 | xprt->address_strings[RPC_DISPLAY_ALL]); |
1621 | 1628 | ||
1622 | return xprt; | 1629 | return xprt; |