]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
rds: tcp: allow progress of rds_conn_shutdown if the rds_connection is marked ERROR...
authorSowmini Varadhan <sowmini.varadhan@oracle.com>
Wed, 31 May 2017 19:08:34 +0000 (12:08 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 10 Jun 2017 00:48:05 +0000 (17:48 -0700)
rds_conn_shutdown() runs in workq context, and marks the rds_connection
as DISCONNECTING before quiescing Tx/Rx paths. However, after all I/O
has quiesced, we may still find the rds_connection state to be
RDS_CONN_ERROR if an intervening FIN was processed in softirq context.

This is not a fatal error: rds_conn_shutdown() should continue the
shutdown, and there is no need to log noisy messages about this event.

Orabug: 26241322

(Cherry-pick of upstream e97656d03ca0cea888a0b9d382abce8233771f31)

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/connection.c

index 99556dfdd4654ead6fad78922dad20a1ed8af487..6cd8b0e7ce7970e109fcf53f60e141b3dc74acc3 100644 (file)
@@ -400,11 +400,20 @@ void rds_conn_shutdown(struct rds_conn_path *cp, int restart)
                rds_conn_path_reset(cp);
 
                if (!rds_conn_path_transition(cp, RDS_CONN_DISCONNECTING,
+                                             RDS_CONN_DOWN) &&
+                   !rds_conn_path_transition(cp, RDS_CONN_ERROR,
                                              RDS_CONN_DOWN)) {
                        /* This can happen - eg when we're in the middle of tearing
                         * down the connection, and someone unloads the rds module.
-                        * Quite reproduceable with loopback connections.
+                        * Quite reproducible with loopback connections.
                         * Mostly harmless.
+                        *
+                        * Note that this also happens with rds-tcp because
+                        * we could have triggered rds_conn_path_drop in irq
+                        * mode from rds_tcp_state change on the receipt of
+                        * a FIN, thus we need to recheck for RDS_CONN_ERROR
+                        * here.
+                        *
                         */
                        pr_warn("RDS: %s: failed to transition to state DOWN, current state is %d\n",
                                __func__, atomic_read(&cp->cp_state));