Commit 51e3dfa
net/smc: fix cleanup for linkgroup setup failures
If an SMC connection to a certain peer is setup the first time,
a new linkgroup is created. In case of setup failures, such a
linkgroup is unusable and should disappear. As a first step the
linkgroup is removed from the linkgroup list in smc_lgr_forget().
There are 2 problems:
smc_listen_decline() might be called before linkgroup creation
resulting in a crash due to calling smc_lgr_forget() with
parameter NULL.
If a setup failure occurs after linkgroup creation, the connection
is never unregistered from the linkgroup, preventing linkgroup
freeing.
This patch introduces an enhanced smc_lgr_cleanup_early() function
which
* contains a linkgroup check for early smc_listen_decline()
invocations
* invokes smc_conn_free() to guarantee unregistering of the
connection.
* schedules fast linkgroup removal of the unusable linkgroup
And the unused function smcd_conn_free() is removed from smc_core.h.
Fixes: 3b2dec2 ("net/smc: restructure client and server code in af_smc")
Fixes: 2a0674f ("net/smc: improve abnormal termination of link groups")
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 402482a commit 51e3dfa
3 files changed
+28
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
515 | 517 | | |
516 | | - | |
517 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
518 | 522 | | |
519 | 523 | | |
520 | 524 | | |
521 | 525 | | |
522 | 526 | | |
523 | | - | |
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
| |||
1091 | 1094 | | |
1092 | 1095 | | |
1093 | 1096 | | |
1094 | | - | |
1095 | 1097 | | |
1096 | 1098 | | |
1097 | 1099 | | |
| |||
1102 | 1104 | | |
1103 | 1105 | | |
1104 | 1106 | | |
1105 | | - | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1106 | 1110 | | |
1107 | 1111 | | |
1108 | 1112 | | |
1109 | 1113 | | |
1110 | | - | |
1111 | 1114 | | |
1112 | 1115 | | |
1113 | 1116 | | |
| |||
1170 | 1173 | | |
1171 | 1174 | | |
1172 | 1175 | | |
1173 | | - | |
1174 | | - | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
1175 | 1179 | | |
1176 | 1180 | | |
1177 | 1181 | | |
1178 | 1182 | | |
1179 | 1183 | | |
1180 | 1184 | | |
1181 | | - | |
1182 | | - | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1183 | 1188 | | |
1184 | 1189 | | |
1185 | 1190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
165 | 177 | | |
166 | 178 | | |
167 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
| |||
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
319 | | - | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
0 commit comments