Commit 0f6142fa authored by David S. Miller's avatar David S. Miller
parents e40dbc51 95c0ec6a
...@@ -177,8 +177,8 @@ static void handle_tx(struct vhost_net *net) ...@@ -177,8 +177,8 @@ static void handle_tx(struct vhost_net *net)
break; break;
} }
if (err != len) if (err != len)
pr_err("Truncated TX packet: " pr_debug("Truncated TX packet: "
" len %d != %zd\n", err, len); " len %d != %zd\n", err, len);
vhost_add_used_and_signal(&net->dev, vq, head, 0); vhost_add_used_and_signal(&net->dev, vq, head, 0);
total_len += len; total_len += len;
if (unlikely(total_len >= VHOST_NET_WEIGHT)) { if (unlikely(total_len >= VHOST_NET_WEIGHT)) {
...@@ -275,8 +275,8 @@ static void handle_rx(struct vhost_net *net) ...@@ -275,8 +275,8 @@ static void handle_rx(struct vhost_net *net)
} }
/* TODO: Should check and handle checksum. */ /* TODO: Should check and handle checksum. */
if (err > len) { if (err > len) {
pr_err("Discarded truncated rx packet: " pr_debug("Discarded truncated rx packet: "
" len %d > %zd\n", err, len); " len %d > %zd\n", err, len);
vhost_discard_vq_desc(vq); vhost_discard_vq_desc(vq);
continue; continue;
} }
...@@ -534,11 +534,16 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) ...@@ -534,11 +534,16 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
rcu_assign_pointer(vq->private_data, sock); rcu_assign_pointer(vq->private_data, sock);
vhost_net_enable_vq(n, vq); vhost_net_enable_vq(n, vq);
done: done:
mutex_unlock(&vq->mutex);
if (oldsock) { if (oldsock) {
vhost_net_flush_vq(n, index); vhost_net_flush_vq(n, index);
fput(oldsock->file); fput(oldsock->file);
} }
mutex_unlock(&n->dev.mutex);
return 0;
err_vq: err_vq:
mutex_unlock(&vq->mutex); mutex_unlock(&vq->mutex);
err: err:
......
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