Commit c0129a06 authored by Cong Wang's avatar Cong Wang Committed by David S. Miller

smc: convert to ->poll_mask

smc->clcsock is an internal TCP socket, after TCP socket
converts to ->poll_mask, ->poll doesn't exist any more.
So just convert smc socket to ->poll_mask too.

Fixes: 2c7d3dac ("net/tcp: convert to ->poll_mask")
Reported-by: syzbot+f5066e369b2d5fff630f@syzkaller.appspotmail.com
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 760a6ed6
...@@ -1273,8 +1273,7 @@ static __poll_t smc_accept_poll(struct sock *parent) ...@@ -1273,8 +1273,7 @@ static __poll_t smc_accept_poll(struct sock *parent)
return mask; return mask;
} }
static __poll_t smc_poll(struct file *file, struct socket *sock, static __poll_t smc_poll_mask(struct socket *sock, __poll_t events)
poll_table *wait)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
__poll_t mask = 0; __poll_t mask = 0;
...@@ -1290,7 +1289,7 @@ static __poll_t smc_poll(struct file *file, struct socket *sock, ...@@ -1290,7 +1289,7 @@ static __poll_t smc_poll(struct file *file, struct socket *sock,
if ((sk->sk_state == SMC_INIT) || smc->use_fallback) { if ((sk->sk_state == SMC_INIT) || smc->use_fallback) {
/* delegate to CLC child sock */ /* delegate to CLC child sock */
release_sock(sk); release_sock(sk);
mask = smc->clcsock->ops->poll(file, smc->clcsock, wait); mask = smc->clcsock->ops->poll_mask(smc->clcsock, events);
lock_sock(sk); lock_sock(sk);
sk->sk_err = smc->clcsock->sk->sk_err; sk->sk_err = smc->clcsock->sk->sk_err;
if (sk->sk_err) { if (sk->sk_err) {
...@@ -1308,11 +1307,6 @@ static __poll_t smc_poll(struct file *file, struct socket *sock, ...@@ -1308,11 +1307,6 @@ static __poll_t smc_poll(struct file *file, struct socket *sock,
} }
} }
} else { } else {
if (sk->sk_state != SMC_CLOSED) {
release_sock(sk);
sock_poll_wait(file, sk_sleep(sk), wait);
lock_sock(sk);
}
if (sk->sk_err) if (sk->sk_err)
mask |= EPOLLERR; mask |= EPOLLERR;
if ((sk->sk_shutdown == SHUTDOWN_MASK) || if ((sk->sk_shutdown == SHUTDOWN_MASK) ||
...@@ -1625,7 +1619,7 @@ static const struct proto_ops smc_sock_ops = { ...@@ -1625,7 +1619,7 @@ static const struct proto_ops smc_sock_ops = {
.socketpair = sock_no_socketpair, .socketpair = sock_no_socketpair,
.accept = smc_accept, .accept = smc_accept,
.getname = smc_getname, .getname = smc_getname,
.poll = smc_poll, .poll_mask = smc_poll_mask,
.ioctl = smc_ioctl, .ioctl = smc_ioctl,
.listen = smc_listen, .listen = smc_listen,
.shutdown = smc_shutdown, .shutdown = smc_shutdown,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment