Skip to content

Commit 54086c5

Browse files
committed
Merge tag 'rxrpc-next-20201015' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
David Howells says: ==================== rxrpc fixes Here are a couple of fixes that need to be applied on top of rxrpc patches in net-next: (1) Fix a bug in the connection bundle changes in the net-next tree. (2) Fix the loss of final ACK on socket shutdown. ==================== Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 0ec78cd + ddc7834 commit 54086c5

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

net/rxrpc/ar-internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ void rxrpc_clean_up_local_conns(struct rxrpc_local *);
831831
* conn_event.c
832832
*/
833833
void rxrpc_process_connection(struct work_struct *);
834+
void rxrpc_process_delayed_final_acks(struct rxrpc_connection *, bool);
834835

835836
/*
836837
* conn_object.c

net/rxrpc/conn_client.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,11 +901,14 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
901901
struct rxrpc_bundle *bundle = conn->bundle;
902902
struct rxrpc_local *local = bundle->params.local;
903903
unsigned int bindex;
904-
bool need_drop = false;
904+
bool need_drop = false, need_put = false;
905905
int i;
906906

907907
_enter("C=%x", conn->debug_id);
908908

909+
if (conn->flags & RXRPC_CONN_FINAL_ACK_MASK)
910+
rxrpc_process_delayed_final_acks(conn, true);
911+
909912
spin_lock(&bundle->channel_lock);
910913
bindex = conn->bundle_shift / RXRPC_MAXCALLS;
911914
if (bundle->conns[bindex] == conn) {
@@ -928,10 +931,11 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
928931
if (i == ARRAY_SIZE(bundle->conns) && !bundle->params.exclusive) {
929932
_debug("erase bundle");
930933
rb_erase(&bundle->local_node, &local->client_bundles);
934+
need_put = true;
931935
}
932936

933937
spin_unlock(&local->client_bundles_lock);
934-
if (i == ARRAY_SIZE(bundle->conns))
938+
if (need_put)
935939
rxrpc_put_bundle(bundle);
936940
}
937941

net/rxrpc/conn_event.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static void rxrpc_secure_connection(struct rxrpc_connection *conn)
397397
/*
398398
* Process delayed final ACKs that we haven't subsumed into a subsequent call.
399399
*/
400-
static void rxrpc_process_delayed_final_acks(struct rxrpc_connection *conn)
400+
void rxrpc_process_delayed_final_acks(struct rxrpc_connection *conn, bool force)
401401
{
402402
unsigned long j = jiffies, next_j;
403403
unsigned int channel;
@@ -416,7 +416,7 @@ static void rxrpc_process_delayed_final_acks(struct rxrpc_connection *conn)
416416
smp_rmb(); /* vs rxrpc_disconnect_client_call */
417417
ack_at = READ_ONCE(chan->final_ack_at);
418418

419-
if (time_before(j, ack_at)) {
419+
if (time_before(j, ack_at) && !force) {
420420
if (time_before(ack_at, next_j)) {
421421
next_j = ack_at;
422422
set = true;
@@ -450,7 +450,7 @@ static void rxrpc_do_process_connection(struct rxrpc_connection *conn)
450450

451451
/* Process delayed ACKs whose time has come. */
452452
if (conn->flags & RXRPC_CONN_FINAL_ACK_MASK)
453-
rxrpc_process_delayed_final_acks(conn);
453+
rxrpc_process_delayed_final_acks(conn, false);
454454

455455
/* go through the conn-level event packets, releasing the ref on this
456456
* connection that each one has when we've finished with it */

0 commit comments

Comments
 (0)