diff options
author | Jason Wang <jasowang@redhat.com> | 2018-05-22 08:21:04 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-23 20:32:12 +0200 |
commit | 2f3ab6221e4c87960347d65c7cab9bd917d1f637 (patch) | |
tree | 5a4050742518ae4b6df94df2ee624e54636770cf /drivers/pps | |
parent | Merge branch 'virtio_net-mergeable-XDP' (diff) | |
download | linux-2f3ab6221e4c87960347d65c7cab9bd917d1f637.tar.xz linux-2f3ab6221e4c87960347d65c7cab9bd917d1f637.zip |
tuntap: correctly set SOCKWQ_ASYNC_NOSPACE
When link is down, writes to the device might fail with
-EIO. Userspace needs an indication when the status is resolved. As a
fix, tun_net_open() attempts to wake up writers - but that is only
effective if SOCKWQ_ASYNC_NOSPACE has been set in the past. This is
not the case of vhost_net which only poll for EPOLLOUT after it meets
errors during sendmsg().
This patch fixes this by making sure SOCKWQ_ASYNC_NOSPACE is set when
socket is not writable or device is down to guarantee EPOLLOUT will be
raised in either tun_chr_poll() or tun_sock_write_space() after device
is up.
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Eric Dumazet <edumazet@google.com>
Fixes: 1bd4978a88ac2 ("tun: honor IFF_UP in tun_get_user()")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/pps')
0 files changed, 0 insertions, 0 deletions