]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/xen/pvcalls-back.c
pvcalls-back: set -ENOTCONN in pvcalls_conn_back_read
[mirror_ubuntu-bionic-kernel.git] / drivers / xen / pvcalls-back.c
index f3289ff3a4d805c06d7a4efee26ae8f02c4f60a4..1c508e66b5691fcd5a4daa3eeac97636d8bb4b5e 100644 (file)
@@ -160,9 +160,10 @@ static void pvcalls_conn_back_read(void *opaque)
 
        /* write the data, then modify the indexes */
        virt_wmb();
-       if (ret < 0)
+       if (ret < 0) {
+               atomic_set(&map->read, 0);
                intf->in_error = ret;
-       else
+       else
                intf->in_prod = prod + ret;
        /* update the indexes, then notify the other end */
        virt_wmb();
@@ -288,7 +289,7 @@ static void pvcalls_sk_state_change(struct sock *sock)
                return;
 
        intf = map->ring;
-       intf->in_error = -ENOTCONN;
+       atomic_inc(&map->read);
        notify_remote_via_irq(map->irq);
 }