diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-03 12:53:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-03 12:53:43 -0400 |
commit | 410da1e12ffed61129d61df5b7adce4d08c7f17c (patch) | |
tree | a31418aa535c04f86aa4ac9a90185d322e58f364 | |
parent | d0fbad0aec1df29717fab736eb24c8a49cf2c70b (diff) |
net/smc: fix up merge error with poll changes
My networking merge (commit 4e33d7d47943: "Pull networking fixes from
David Miller") got the poll() handling conflict wrong for af_smc.
The conflict between my a11e1d432b51 ("Revert changes to convert to
->poll_mask() and aio IOCB_CMD_POLL") and Ursula Braun's 24ac3a08e658
("net/smc: rebuild nonblocking connect") should have left the call to
sock_poll_wait() in place, just without the socket lock release/retake.
And I really should have realized that. But happily, I at least asked
Ursula to double-check the merge, and she set me right.
This also fixes an incidental whitespace issue nearby that annoyed me
while looking at this.
Pointed-out-by: Ursula Braun <ubraun@linux.ibm.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | net/smc/af_smc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index e017b6a4452b..3c1405df936c 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c | |||
@@ -1345,6 +1345,8 @@ static __poll_t smc_poll(struct file *file, struct socket *sock, | |||
1345 | if (sk->sk_err) | 1345 | if (sk->sk_err) |
1346 | mask |= EPOLLERR; | 1346 | mask |= EPOLLERR; |
1347 | } else { | 1347 | } else { |
1348 | if (sk->sk_state != SMC_CLOSED) | ||
1349 | sock_poll_wait(file, sk_sleep(sk), wait); | ||
1348 | if (sk->sk_err) | 1350 | if (sk->sk_err) |
1349 | mask |= EPOLLERR; | 1351 | mask |= EPOLLERR; |
1350 | if ((sk->sk_shutdown == SHUTDOWN_MASK) || | 1352 | if ((sk->sk_shutdown == SHUTDOWN_MASK) || |
@@ -1370,7 +1372,6 @@ static __poll_t smc_poll(struct file *file, struct socket *sock, | |||
1370 | } | 1372 | } |
1371 | if (smc->conn.urg_state == SMC_URG_VALID) | 1373 | if (smc->conn.urg_state == SMC_URG_VALID) |
1372 | mask |= EPOLLPRI; | 1374 | mask |= EPOLLPRI; |
1373 | |||
1374 | } | 1375 | } |
1375 | 1376 | ||
1376 | return mask; | 1377 | return mask; |