diff options
Diffstat (limited to 'net/tls/tls_main.c')
-rw-r--r-- | net/tls/tls_main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c index 3aafb871a0a8..4b57ddd72f34 100644 --- a/net/tls/tls_main.c +++ b/net/tls/tls_main.c | |||
@@ -114,6 +114,7 @@ int tls_push_sg(struct sock *sk, | |||
114 | size = sg->length - offset; | 114 | size = sg->length - offset; |
115 | offset += sg->offset; | 115 | offset += sg->offset; |
116 | 116 | ||
117 | ctx->in_tcp_sendpages = true; | ||
117 | while (1) { | 118 | while (1) { |
118 | if (sg_is_last(sg)) | 119 | if (sg_is_last(sg)) |
119 | sendpage_flags = flags; | 120 | sendpage_flags = flags; |
@@ -148,6 +149,8 @@ retry: | |||
148 | } | 149 | } |
149 | 150 | ||
150 | clear_bit(TLS_PENDING_CLOSED_RECORD, &ctx->flags); | 151 | clear_bit(TLS_PENDING_CLOSED_RECORD, &ctx->flags); |
152 | ctx->in_tcp_sendpages = false; | ||
153 | ctx->sk_write_space(sk); | ||
151 | 154 | ||
152 | return 0; | 155 | return 0; |
153 | } | 156 | } |
@@ -217,6 +220,10 @@ static void tls_write_space(struct sock *sk) | |||
217 | { | 220 | { |
218 | struct tls_context *ctx = tls_get_ctx(sk); | 221 | struct tls_context *ctx = tls_get_ctx(sk); |
219 | 222 | ||
223 | /* We are already sending pages, ignore notification */ | ||
224 | if (ctx->in_tcp_sendpages) | ||
225 | return; | ||
226 | |||
220 | if (!sk->sk_write_pending && tls_is_pending_closed_record(ctx)) { | 227 | if (!sk->sk_write_pending && tls_is_pending_closed_record(ctx)) { |
221 | gfp_t sk_allocation = sk->sk_allocation; | 228 | gfp_t sk_allocation = sk->sk_allocation; |
222 | int rc; | 229 | int rc; |